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

bug: openid-client not included in dependencies which crashes when using pnpm #1724

Closed
erikash opened this issue Jan 12, 2024 · 3 comments
Closed

Comments

@erikash
Copy link

erikash commented Jan 12, 2024

Provide environment information

System:
OS: macOS 14.2.1
CPU: (10) arm64 Apple M1 Pro
Memory: 326.64 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.17.1 - ~/.nvm/versions/node/v18.17.1/bin/node
npm: 9.6.7 - ~/.nvm/versions/node/v18.17.1/bin/npm
pnpm: 8.11.0 - ~/.nvm/versions/node/v18.17.1/bin/pnpm

Describe the bug

On a fresh run of create-t3-app the Discord NextAuth login returned an error:

      at async Client.oauthCallback (webpack-internal:///(rsc)/./node_modules/.pnpm/openid-client@5.6.3/node_modules/openid-client/lib/client.js:532:30)
      at async oAuthCallback (webpack-internal:///(rsc)/./node_modules/.pnpm/next-auth@4.24.5_next@14.0.4_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/core/lib/oauth/callback.js:120:22)
      at async Object.callback (webpack-internal:///(rsc)/./node_modules/.pnpm/next-auth@4.24.5_next@14.0.4_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/core/routes/callback.js:18:79)
      at async AuthHandler (webpack-internal:///(rsc)/./node_modules/.pnpm/next-auth@4.24.5_next@14.0.4_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/core/index.js:202:38)
      at async NextAuthRouteHandler (webpack-internal:///(rsc)/./node_modules/.pnpm/next-auth@4.24.5_next@14.0.4_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/next/index.js:50:30)
      at async NextAuth._args$ (webpack-internal:///(rsc)/./node_modules/.pnpm/next-auth@4.24.5_next@14.0.4_react-dom@18.2.0_react@18.2.0/node_modules/next-auth/next/index.js:85:24)
      at async /Users/erikashepa/Projects/budget/node_modules/.pnpm/next@14.0.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:63251 {
    name: 'OAuthCallbackError',
    code: undefined
  },
  providerId: 'discord',
  message: 'invalid_client'

After pnpm i openid-client, rerunning the app I was able to successfully login.

Reproduction repo

To reproduce

pnpm create t3-app@latest

Additional information

No response

@FinnDore
Copy link
Contributor

I can't do anything without a repro.

NEXT!

(kindly add a repro)

@erikash
Copy link
Author

erikash commented Jan 15, 2024

NP @FinnDore .
Here it is:
https://github.com/erikash/pnpm-create-t3-app-repro

Just make sure to pnpm i and update the .env for Discord Auth.

You'll get the above error.
After pnpm i openid-client, rerunning the app I was able to successfully login.

@juliusmarminge
Copy link
Member

repro works fine for me, guessing it has to do with some pnpm version not installing proper peerdeps / resolving versions below accepted range.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants