Convex Auth URL undefined
Any Idea what would cause this when using convex auth and Next app router? The error appears when the user trys to sign in. We get a 500 error code at the /api/auth route. We also have the NEXT_PUBLIC_SITE_URL set and this worked prior.
Error:
url
property passed to convex/nextjs function but is undefined. Is an environment variable not set? If this is intended remove 'url' from the preloadQuery options.
Error [ERR_HTTP_HEADERS_SENT]: Cannot append headers after they are sent to the client20 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
i believe this was a bug introduced in convex 1.18.0 and fixed in 1.18.1. can you try upgrading?
Okay, so I upgraded, I am just going back through to see if I missed anything. Just getting this issue now:
Hit error while running
auth:signIn
:
Error: url
property passed to convex/nextjs function but is undefined. Is an environment variable not set? If this is intended remove 'url' from the preloadQuery options.to confirm, you're seeing the same error on version 1.18.1?
Correct, I was only seeing the error in production prior to upgrading, now I see it local as well.
hmm that's unexpected. can you share output of
npm ls

I am trying to back track and make sure I have all of my files in order auth.ts/auth.config.ts/middleware. I am not sure if anything else requires an upgrade. We are using convex auth password flow for context,
i think we found the bug on our side. in the meantime you could downgrade to 1.17.4. sorry about this
Okay, thanks for looking into it. I was going nuts this morning trying to find the issue. Interestingly enough, all of our users on the EST timezone can not log in, but we have one user on PST time west coast who can still. lol
Sorry for the inconvenience here @meltonstudios, 1.18.2 is now out and should resolve the issue
Thanks team, much appreciated!
Thanks a lot, I just started learning convex in a youtube video and was getting this error, upgraded the version.
Okay, it appears to still have the same error. What is the exact variable this is looking for? Error: url property passed to convex/nextjs function but is undefined.
What versions are you using?
"convex": "^1.18.2",
what about
npm ls convex
that will tell us what's actually installed
instead of what appears in your package.json
How did you upgrade? By editing the package.json file or running a command?Ah I see it didn't install correctly. Needed --force
Ah interesting, probably not related to this issue but would be interested to see the error that stopped it
there's a lot of --force being required with React 19 not having full library support yet, but if it is related to convex it's something we want to fix
Yeah, that isn't you something with Next 15/React 19
Issue is resolved. Thanks team