-
-
Notifications
You must be signed in to change notification settings - Fork 789
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
Unable to use next-auth with provider: Error [ERR_PACKAGE_PATH_NOT_EXPORTED] #4143
Comments
Hey @imadarchid, thanks for the issue. I am taking a look now. Would it be possible for you to provide a simple reproduction with a brand new app? |
Hi @siddhsuresh, thanks for your reply. Here's a repo based on a new blitz app. |
Thanks for the reproduction, I will take a look and let you know |
@siddhsuresh
"exports": {
".": "./index.js",
"./jwt": "./jwt/index.js",
"./react": "./react/index.js",
"./core": "./core/index.js",
"./core/*": "./core/*.js", // new export
"./next": "./next/index.js",
"./middleware": "./middleware.js",
"./client/_utils": "./client/_utils.js",
"./providers/*": "./providers/*.js"
}, In addition, I suspect there are some inconsistencies in module systems between both libraries. Anyway, I hope this is helpful. I am happy to open a PR to address the first point but would like to have your input on this first. Thanks. |
Hey @imadarchid, thanks for the time you spend on this. Yes, both your points are correct and making a patch with your mentioned package.json will make the adapter work in the mean time. The purpose of making this adapter was to enhance the features of blitz-auth which already does email and traditional authenticated with the DX of the next auth OAuth providers. I am in the process of making a PR for fixing the current adapter. Feel free to push a PR for the email adapter if it is a part of your requirement. |
Thanks @siddhsuresh. I am mainly using NextAuth because I want to implement passwordless signin with magic links. The EmailProvider has a straightforward support for this. |
@imadarchid Ah okay then, we should support the EmailProvider, are you willing to work on this? |
@siddhsuresh yes will try to spend some more time on this and open a PR when it's ready. |
The problem is still present with Blitz 2.0.0-beta.33. Is there any solution in sight? |
Feedback from @siddhsuresh from Discord @elsueno:
Also Ping @siddhsuresh for reopening this issue. |
@elsueno The main problem is |
I've added the following
Obviously less than ideal, but it hopefully won't immediately break any time package.json changes. |
@pzskyz , @Aeolun, @siddhsuresh is there a ticket on this issue in the next-auth repo? I could not find any. I am not really clear on how to describe the issue properly, so chances are if one of you opened an issue it will sound more profound and is more likely taken seriously. I think the first step would be to open a ticket before providing a PR so the community over there can comment on the topic from their point of view… |
Any solution for using next-auth with blitz ? this is still causing issues on |
@msShanky our current workaround is to patch the package. This turned out to be the better solution on different operating systems then the
The nice thing about this is, once you update something you get a notice to update the patch. |
@tordans I did try the same but encountering issues with |
@msShanky Try for this patch file I used fo fix blitzjs-auth using for integrated for next-auth. Correct version you used in @blitzjs+auth+2.0.0-beta.33.patch |
What is the problem?
Hi there,
I am currently unable to configure a next-auth provider (EmailProvider) on blitz. I followed the configuration steps that are available in the docs (https://blitzjs.com/docs/next-auth), but this error occurs when I try to access the auth link (api/auth/email (or any other provider)/login).
The following error is what I keep getting:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './core/init' is not defined by "exports" in /Users/imadarchid/Desktop/Repositories/fire/node_modules/next-auth/package.json imported from /Users/imadarchid/Desktop/Repositories/fire/node_modules/@blitzjs/auth/dist/next-auth.cjs
Paste all your error logs here:
Paste all relevant code snippets here:
What are detailed steps to reproduce this?
Run
blitz -v
and paste the output here:Please include below any other applicable logs and screenshots that show your problem:
No response
The text was updated successfully, but these errors were encountered: