-
Notifications
You must be signed in to change notification settings - Fork 408
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
@auth0/nextjs-auth0 4.0.0-beta.8 next15.0.3 not working on vercel cloud #1832
Comments
Hey @droganov 👋 It looks like the error you're getting is related to the discovery request — this happens when the SDK fetches metadata about your Auth0 tenant. This error typically happens when the Could you share your exact value for your I agree, the error message can definitely be improved here. We'll make sure to add a more descriptive message here — thanks for the feedback! |
@guabu sure! Both fail with the same error, both work locally. I would say Auth0 Vercel integration spoils env, but let me check first |
@guabu AUTH0_DOMAIN was missing for some reason, could be cache. I edited env manually in deployment props, and got a new crash error: ![]() Vercel logs:
|
Hey @guabu, I finally got it working. Here's what I discovered:
|
Thanks for following up @droganov! I'm glad to hear the issue was resolved — ultimately it seems like the environment variables were not correctly being set on Vercel. I've added a log in the upcoming release that will hopefully make it easier to troubleshoot these errors based on your feedback! |
Checklist
Description
I’m experiencing a similar issue to the one discussed in this thread: Trying out v4 beta, receiving generic error
The key difference is that I’ve managed to get it working locally, but when I attempt to access “/auth/login” on either Vercel or my app domain, I receive a generic error message stating “An error occurred while trying to initiate the login request.”
My application is configured as a “Regular Web Application” with the following settings:
Allowed Callback URLs:
Allowed Logout URLs:
My environment variables are set as follows:
.env.local
.env.production
As I mentioned earlier, this setup works seamlessly on my local machine, but throws an error when deployed to Vercel. The Vercel logs reveal the following error:
Hi: "response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)
at (node_modules/.pnpm/oauth4webapi@3.1.3/node_modules/oauth4webapi/build/index.js:92:0)
at (node_modules/.pnpm/oauth4webapi@3.1.3/node_modules/oauth4webapi/build/index.js:221:0)
at (node_modules/.pnpm/@auth0+nextjs-auth0@4.0.0-beta.8_next@15.0.3_react-dom@18.3.1_react@18.3.1__react@18.3.1_sass_nalkpas7ifge363zka4f67ub7m/node_modules/@auth0/nextjs-auth0/dist/server/auth-client.js:369:36)
at (node_modules/.pnpm/@auth0+nextjs-auth0@4.0.0-beta.8_next@15.0.3_react-dom@18.3.1_react@18.3.1__react@18.3.1_sass_nalkpas7ifge363zka4f67ub7m/node_modules/@auth0/nextjs-auth0/dist/server/auth-client.js:365:0)
at (node_modules/.pnpm/@auth0+nextjs-auth0@4.0.0-beta.8_next@15.0.3_react-dom@18.3.1_react@18.3.1__react@18.3.1_sass_nalkpas7ifge363zka4f67ub7m/node_modules/@auth0/nextjs-auth0/dist/server/auth-client.js:92:0)
at (src/middleware.ts:6:9)
at (node_modules/.pnpm/next@15.0.3_react-dom@18.3.1_react@18.3.1__react@18.3.1_sass@1.81.0/node_modules/next/dist/esm/server/web/adapter.js:212:0)
at (node_modules/.pnpm/next@15.0.3_react-dom@18.3.1_react@18.3.1__react@18.3.1_sass@1.81.0/node_modules/next/dist/esm/server/web/adapter.js:163:0)
and, as @bryso mentioned, it would be really nice to have informative errors, or at least log traces, where we can see which url is requested and what response is receved
Reproduction
src/components/Auth/auth0SDK.ts:
src/middleware.ts
.env.production
src/components/Auth/useAuth.ts
src/components/Auth/DashboardLink.tsx
Visiting
/auth/login
results inAn error occured while trying to initiate the login request.
Additional context
No response
nextjs-auth0 version
@auth0/nextjs-auth0 4.0.0-beta.8
Next.js version
next15.0.3
Node.js version
20.10.0
The text was updated successfully, but these errors were encountered: