Skip to content

Fails in next-auth@beta in Next.js 14 #1017

@igmtink

Description

@igmtink
  • What went wrong?
    I followed this tutorial provided by Next.js 14
    Using bcrypt inside of auth.config.ts of next-auth@beta in Next.js 14 causes the app to crash with unusual errors:

image

./node_modules/.pnpm/@[email protected]/node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> <!doctype html>
| <html>
| <head>

Import trace for requested module:
./node_modules/.pnpm/@[email protected]/node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html
./node_modules/.pnpm/@[email protected]/node_modules/@mapbox/node-pre-gyp/lib/ sync ^\.\/.*$
./node_modules/.pnpm/@[email protected]/node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js
./node_modules/.pnpm/[email protected]/node_modules/bcrypt/bcrypt.js
./lib/auth/auth.config.ts
  • What did you expect to happen?
    bcrypt should work in next-auth@beta in Next.js 14

  • Which version of nodejs and OS?

Operating System:
  Platform: Windows 11
  Version: 23H2
Binaries:
  Node: 23.3.0
  npm: 10.2.4
  pnpm: 8.12.1
Relevant packages:
  next: 14.0.4
  next-auth: 5.0.0-beta.4
  react: ^18
  react-dom: ^18
  • If you find a bug, please write a failing test.
    Ok, maybe once I find out more.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions