deploymentURL is undefined
When I use convex Auth with my next JS app, I get this error once in a few minutes:
app/layout.tsx:
9 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!
Can you share your middleware
sorry I didn't get the notification.
here's the middleware.ts:
And it also causes me to lose the authenticated user sometimes. So I have to log in again.
GET /.well-known/appspecific/com.chrome.devtools.json 404 in 1045msThis appears to be related to Chrome Automatic Workspace Folders, not sure how to help there
deploymentUrl is undefined, are your environment variables set? In the future explicitly passing undefined will cause an error. To explicitly use the default, pass process.env.NEXT_PUBLIC_CONVEX_URL
This means you're not passing a value to new ConvexReactClient()
, can you share the source for your ConvexClientProvider
npx convex dev sets this automatically in your .env.local, so maybe this all somehow has to do with your Chrome Automatic Workspace Folder setup? If it's generally working but then sometimes not, not sure how that environment variable becomes undefined intermittently under normal usage.ConvexClientProvider.tsx:
I'm using ConvexAuthNextjsProvider as it's recommended to be used with convex auth in a next js project
The deploymentUrl error is saying
process.env.NEXT_PUBLIC_CONVEX_URL
isn't defined
Is it defined in your .env.localyes. The project does get launched properly and I can use it. But this deploymentURL issue will occur once in a while as the project is already running. In most cases, it doesn't break the app. It refreshes and I can keep using the application. But sometimes it will disrupt the connectiion with convex and sometimes the authenticated session will get lost and I'll have to login again.
Are you using chrome automatic workspace folders?
That's where this error seems to be starting, I suspect it's causing issues when running locally. Curious if this happens in your production deployment from a production site with no dev tooling running in chrome.
(or just try accessing your dev site from a different browser)
no. when I use firefox, I get don't get the chrome error. I just get his:
I can also see this on chrome tho:
Although I have not tested thoroughly, I think I stopped getting this error when I avoided using the
convex auth
. Or perhaps, it was caused by ConvexAuthNextjsProvider
I plan to test it out properly.