-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fails in next-auth@beta in Next.js 14 #1017
Comments
@igmtink I'm experiencing the same issue. Found any solution? |
Experiencing same issue here :/ |
i don't find any solution until now |
Same. Got the same error at version Next.js 13.5. No fix so far. |
but new release with this change hasn't come yet
once it releases, this will be resolved (hopefully) |
Workaround:
const authConfig = {
//...
providers: [], // Add providers with an empty array for now
}
const { auth } = NextAuth({ authConfig }) // called in `middleware.ts`
const { signIn, singOut } = NextAuth({
...authConfig,
providers: [
// your logic with `bcrypt`
],
});
|
bcrypt will never be compatible with a server-side bundler platform. If nextjs allows to exclude some modules to be bundled then it would work |
@recrsn would you give me a bit more explanation please? What I understood:
|
I switched from bcrypt to bcryptjs and it worked for me. I had to uninstall bcrypt & @types/bcrypt and install bcryptjs & @types/bcryptjs instead and restart the app (don't know why it didn't work without an uninstallation). Hope it will work for you |
For me, the crypto module not found error occurs using bcryptjs. Do you have this issue? |
I do not have this issue, try to remove node_modules, uninstall bcrypt & @types/bcrypt, and try to reinstall node_modules, hope it will work :( |
same problem for me. Could make it work locally by using --force to install, but then vercel would crash when building throwing this error: Expand 7 Lines08:48:00.993 | Installing dependencies... |
@2wheeh The edge runtime is not NodeJS, any native modules will not work there
|
Changing from |
This issue still exists , any solution ? |
@shumakmanohar try and look if u made a mistake 'use client' -> 'use server' for me it worked this method. |
middleware is all problem, remove it or found another solution 😀 |
Not re-exporting in index.ts works for me |
very nice of you to mention this, problem solved! i forgot to declare 'use server' |
Any update please? for me using bcryptjs is not a good solution, the package did not get any update since 8 years.. EDIT: I just switched from bcrypt to crypto
|
I followed this tutorial provided by Next.js 14
Using
bcrypt
inside ofauth.config.ts
ofnext-auth@beta
in Next.js 14 causes the app to crash with unusual errors:What did you expect to happen?
bcrypt
should work innext-auth@beta
in Next.js 14Which version of nodejs and OS?
Ok, maybe once I find out more.
The text was updated successfully, but these errors were encountered: