W
Wasp-langβ€’2d ago
khb

Site works in dev but in production is not working

Hello again friends! We've finally launched to production! πŸŽ‰ https://siteengineer.com.au/ The site works when I run it in development mode, however, after launching, the login option disappears and the website doesn't seem to work (though it still builds). I've included the command line output which shows several errors I'm unsure about, along with the errors that VS Code outputs when I launch the site. Would anyone have any suggestions? my version is 15.1 (updated from 14.x), my platform is windows / wsl2. all errors are attached :))
My Open SaaS App
I made a SaaS App. Buy my stuff.
6 Replies
kapa.ai
kapa.aiβ€’2d ago
Hi @khb. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the information provided in the knowledge sources, it seems your issue is related to deployment and environment configuration. Let's go through some potential causes and solutions: 1. Environment Variables: Make sure you've properly set up all the necessary environment variables for production. As mentioned in the Wasp docs on env variables (https://wasp-lang.dev/docs/project/env-vars#defining-env-vars-in-production), you need to provide server env vars differently in production compared to development. For example, if you're using Fly.io, you would set secrets using the flyctl CLI tool:
flyctl secrets set SOME_VAR_NAME=somevalue

flyctl secrets set SOME_VAR_NAME=somevalue

Ensure all required variables, especially those related to authentication (like Google client ID), are properly set in your production environment. 2. Database Migration: It's possible that your database schema needs to be updated in production. As discussed in a GitHub issue about database migration (https://github.com/wasp-lang/wasp/issues/215), you might need to run database migrations as part of your deployment process. Consider running wasp db migrate-prod (or equivalent command) before deploying your app. 3. Build Process: The Wasp docs on accessing app config (https://wasp-lang.dev/docs/advanced/accessing-app-config) mention that the client process in production serves pre-built static files with environment variables embedded during the build. Make sure your build process is correctly incorporating all necessary environment variables. 4. Server Configuration: Double-check your server configuration, especially the frontendUrl setting. As mentioned in the Wasp docs, you should set this to your client's URL as the server sees it in production. 5. Proxy Issues: There's a known issue with Wasp's dev server (https://github.com/wasp-lang/wasp/issues/1255) that can cause Failed to fetch errors. While this primarily affects development, it's worth checking if similar issues could be occurring in your production setup. 6. Deployment Process: Review your deployment process to ensure all steps are being executed correctly. The Wasp docs on deployment (https://wasp-lang.dev/docs/advanced/deployment/manually#environment-variables) provide guidance on setting up environment variables and other deployment considerations. To troubleshoot further: 1. Check the server logs in your production environment for any error messages. 2. Use browser developer tools to inspect network requests and console errors on the client side. 3. Verify that all necessary environment variables are correctly set in your production environment. 4. Consider temporarily enabling more verbose logging in your production environment to gather more information about the issues. If the problem persists after checking these areas, you may need to provide more specific error messages or logs for further assistance. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @khb, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
khb
khbOPβ€’2d ago
here is some back end server logs if that helps
NEROX
NEROXβ€’2d ago
NEROX
NEROXβ€’2d ago
Do you use mailgun? Have you deployed the variables correctly?
No description
miho
mihoβ€’2d ago
@khb as @NEROX pointed out, your server is down (that's why the login button disappears) - do you see any errors in the server logs? Did you set all the env variables on Fly - remember, what you have in .env.server is not copied over to the production env, you need to define all the env variables you need e.g. Mailgun API key, Google ID and secret etc.
khb
khbOPβ€’this hour
Ohhh okay, ill have to try do that tonight. My bad ill keep this post updated if that fixes my problem. Thanks for the help guys. I also do use mailgun, however i dont think i have deployed the varables correctly.
Want results from more Discord servers?
Add your server