Omar Farooq
Omar Farooq3y ago

prod app connection issues

Having a weird situation where all of the code is working on the dev instance of our convex app on localhost, but when uploading to prod (and prodURL is correctly set) to a live server, nothing executes. How can we troubleshoot?
13 Replies
sujayakar
sujayakar3y ago
hey @Omar Farooq ! sorry you’re running into issues. are you seeing network errors in the prod deployment of your web app? or is it just silently failing? if you’d like to DM me a URL to your prod app, i’d be happy to take a look.
sujayakar
sujayakar3y ago
poking around the network tab of chrome ‘s developer tools (https://developer.chrome.com/docs/devtools/network/) to find the failing requests to the convex backend would be helpful troubleshooting info too
Chrome Developers
Inspect network activity - Chrome Developers
A tutorial on the most popular network-related features in Chrome DevTools.
sujayakar
sujayakar3y ago
also, @Omar Farooq , how are you deploying your app to production? if you're using something like vercel or netlify, we have some instructions here: https://docs.convex.dev/using/hosting/vercel the important part is that npx convex deploy pushes your functions to your production deployment on convex and then updates the local clientConfig.js to point to your production deployment. then, pushing your web app (either locally via vercel's CLI or through their build system) will include the URL to this production deployment in its bundle.
Using Convex with Vercel | Convex Developer Hub
Host your frontend on Vercel and your backend on Convex.
sujayakar
sujayakar3y ago
also, another caveat is that npm run dev (if copied from one of our demo apps) will run npx convex dev, which will rewrite the config files to point to your development deployment. we understand this stuff is a bit confusing/error prone and are working on simplifying it!
Omar Farooq
Omar FarooqOP3y ago
@sujayakar Looks like it is the latter, have to update this
Omar Farooq
Omar FarooqOP3y ago
No description
Omar Farooq
Omar FarooqOP3y ago
hmm no that wasn't it but after i updated that to the production deployment i got this error Error: [CONVEX Q(getTwitter.js:default)] Couldn't find JavaScript module 'getTwitter.js'. Did you forget to run npx convex dev or npx convex deploy? so it's something related to this
Omar Farooq
Omar FarooqOP3y ago
this was always correct from the get go
No description
sujayakar
sujayakar3y ago
hmm, yeah, you shouldn't have to manually edit the clientConfig to point it to prodUrl, npx convex deploy will do that for you + also push your functions to your production deployment. to double check, if you go to your project in the dashboard (dashboard.convex.dev), click on "dev" in the top left, and switch it to "production":
sujayakar
sujayakar3y ago
No description
sujayakar
sujayakar3y ago
do you see getTwitter within the functions view? also, let me know if you'd like to hop on a call so we can pair on getting this working. sorry it's been such a pain so far.
ian
ian3y ago
One thing I've run into in the past is if npx convex dev is running in one terminal and you run npx convex deploy in another, they'll overwrite each other, and the config might be written back to dev before the deploy finishes
Omar Farooq
Omar FarooqOP3y ago
Hey guys thank you for the additional information, we will keep all of this in mind moving forward. @ian Thanks so much for the offer to hop on a call, I'll save that offer for now as we're shifting resources to a different, more vital endpoint, that one where we ran into that error was more superfluous. No issues so far on the main work, it's going great. I'll be in touch with any questions or issues if they arise!

Did you find this page helpful?