meltonstudios
meltonstudios2mo ago

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 client
20 Replies
Convex Bot
Convex Bot2mo ago
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!
lee
lee2mo ago
i believe this was a bug introduced in convex 1.18.0 and fixed in 1.18.1. can you try upgrading?
meltonstudios
meltonstudiosOP2mo ago
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.
lee
lee2mo ago
to confirm, you're seeing the same error on version 1.18.1?
meltonstudios
meltonstudiosOP2mo ago
Correct, I was only seeing the error in production prior to upgrading, now I see it local as well.
lee
lee2mo ago
hmm that's unexpected. can you share output of npm ls
meltonstudios
meltonstudiosOP2mo ago
No description
meltonstudios
meltonstudiosOP2mo ago
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,
lee
lee2mo ago
i think we found the bug on our side. in the meantime you could downgrade to 1.17.4. sorry about this
meltonstudios
meltonstudiosOP2mo ago
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
ballingt
ballingt2mo ago
Sorry for the inconvenience here @meltonstudios, 1.18.2 is now out and should resolve the issue
meltonstudios
meltonstudiosOP2mo ago
Thanks team, much appreciated!
siddharth
siddharth2mo ago
Thanks a lot, I just started learning convex in a youtube video and was getting this error, upgraded the version.
meltonstudios
meltonstudiosOP2mo ago
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.
ballingt
ballingt2mo ago
What versions are you using?
meltonstudios
meltonstudiosOP2mo ago
"convex": "^1.18.2",
ballingt
ballingt2mo ago
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?
meltonstudios
meltonstudiosOP2mo ago
Ah I see it didn't install correctly. Needed --force
ballingt
ballingt2mo ago
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
meltonstudios
meltonstudiosOP2mo ago
Yeah, that isn't you something with Next 15/React 19 Issue is resolved. Thanks team

Did you find this page helpful?