Skip to content
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

can't integrate social sign in #4370

Closed
Vandivier opened this issue Aug 17, 2024 · 2 comments
Closed

can't integrate social sign in #4370

Vandivier opened this issue Aug 17, 2024 · 2 comments
Labels
kind/bug Something isn't working status/done

Comments

@Vandivier
Copy link
Contributor

What is the problem?

When I wrap my Next.js config with withNextAuthAdapter as instructed, I see the following error on server startup (via npm run dev ie blitz dev):

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './core/init' is not defined by "exports" in /Users/johnvandivier/workspace/ladderly-3/node_modules/next-auth/package.json

Paste all your error logs here:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './core/init' is not defined by "exports" in /Users/johnvandivier/workspace/ladderly-3/node_modules/next-auth/package.json

Paste all relevant code snippets here:

n/a

What are detailed steps to reproduce this?

  1. set up new app
  2. install next-auth
  3. update next.config.js to use withNextAuthAdapter
  4. run server

Run blitz -v and paste the output here:

blitz -v
Blitz version: 2.0.9 (global)
Blitz version: 2.0.9 (local)
macOS Ventura | darwin-arm64 | Node: v20.15.0


 Package manager: npm

  System:
    OS: macOS 13.5.2
    CPU: (8) arm64 Apple M2
    Memory: 47.13 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.15.0 - ~/.nvm/versions/node/v20.15.0/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - ~/.nvm/versions/node/v20.15.0/bin/npm
  npmPackages:
    @blitzjs/auth: 2.0.9 => 2.0.9 
    @blitzjs/next: 2.0.9 => 2.0.9 
    @blitzjs/rpc: 2.0.9 => 2.0.9 
    @prisma/client: 5.4.2 => 5.4.2 
    blitz: 2.0.9 => 2.0.9 
    next: 14.2.3 => 14.2.3 
    prisma: 5.4.2 => 5.4.2 
    react: 18.2.0 => 18.2.0 
    react-dom: 18.2.0 => 18.2.0 
    typescript: ^4.8.4 => 4.9.5 

Please include below any other applicable logs and screenshots that show your problem:

some other useful dep versions:


    "@blitzjs/auth": "2.0.9",
    "@blitzjs/next": "2.0.9",
    "@blitzjs/rpc": "2.0.9",
    "@next-auth/prisma-adapter": "1.0.7",
@Vandivier Vandivier added kind/bug Something isn't working status/triage labels Aug 17, 2024
@Vandivier
Copy link
Contributor Author

@siddhsuresh
Copy link
Member

@Vandivier apologies about the delay in responding

There is no current way of getting next-auth working without a manual patch. I am working on checking for a fix, but more monkey patching will not be solution, until the next-auth team allows more internal exports

This patch or the exports in these files are needed for the social sign in to work.

diff --git a/package.json b/package.json
index c89e03c41a03de738cfb0ad090a63c2e99dadc7b..a5f38083c24732651c427c2b2d17cbcb23495473 100644
--- a/package.json
+++ b/package.json
@@ -57,6 +57,18 @@
     "./providers/*": {
       "types": "./providers/*.d.ts",
       "default": "./providers/*.js"
+    },
+    "./core/init": {
+      "types": "./core/init.d.ts",
+      "default": "./core/init.js"
+    },
+    "./core/lib/oauth/authorization-url": {
+      "types": "./core/lib/oauth/authorization-url.d.ts",
+      "default": "./core/lib/oauth/authorization-url.js"
+    },
+    "./core/lib/oauth/callback": {
+      "types": "./core/lib/oauth/callback.d.ts",
+      "default": "./core/lib/oauth/callback.js"
     }
   },
   "files": [

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working status/done
Projects
Status: Done
Development

No branches or pull requests

3 participants