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
Adds an extension for NextAuth.js #2493
Conversation
I tried to patch NextAuth.js first but they rejected it. So I'm fixing Next.js and Yarn instead. I already have fixed the Next.js side and this is the remaining piece. References: nextauthjs/next-auth#1034 vercel/next.js#20971
b346fed
to
b481061
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we mentioned in the linked issues it was a problem with how Next.js provided the polyfill for process
so adding it as a dependency to next-auth
isn't the correct fix, do you have a repro that shows that it's still needed so it can be fixed in Next.js?
I tested with https://github.com/nextauthjs/next-auth-example but can't reproduce it
As I stated in vercel/next.js#20971 (comment), it's not yet. It fails when you use it with Webpack 5. How to reproduce the issue:
References |
I can't repro it either anymore. I just checked with my project in which I originally found the problem where a week ago I needed this to fix the packageExtensions:
next-auth@*:
dependencies:
process: "^0.11.10" but now I removed it, tested it (first it failed), but after updating next-auth to |
The error reproduction above is using the latest version of next and next-auth. Reference |
Yeah that makes it a missing polyfill in Next.js, see vercel/next.js#22247 and https://github.com/vercel/next.js/blob/fea5c18132146976913f4148210b74d6d9b1ef8c/packages/next/build/webpack-config.ts#L394-L398 |
Does adding Reference |
You need to use |
Reference: yarnpkg/berry#2493 (comment)
Currently there's no known solution or workaround of vercel/next.js#22247, shall we reopen this PR? |
What's the problem this PR addresses?
NextAuth.js is not usable with Yarn 2 PnP due to wrong dependency. I tried to patch NextAuth.js first but they rejected it. So I'm fixing Next.js and Yarn instead. I already have fixed the Next.js side and this is the remaining piece.
How did you fix it?
Added an extension
Checklist
References