Suddenly no Apps including new files can access server
@kapa.ai I was troubleshooting some API calls when I suddenly lost authorization. So I messed with it a bit and figured I had messed something up so I did a fresh install of opensaas and that file can't access it either.
4 Replies
Hi @wbjb. 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 knowledge sources provided, there are a few potential issues that could be causing your authorization problems and inability to access the server. Here are some relevant points and suggestions:
1. JWT Token Clearing: There's an open issue in Wasp regarding how JWT tokens are handled when verification fails. Currently, a 401 response causes the auth token to be cleared, which can lead to unexpected logouts. This behavior is being revisited. Handle case when JWT token verification fails
2. Auth Kicking Out: There's a known issue where hitting a 401 error in one tab can log you out across all tabs due to shared localStorage. This can happen even if some pages don't require authentication. Auth kicking out
3. Server Issues: Some users have reported unexpected server problems on fly.io, where the app stops working without any redeployments or updates. This manifests as the client not getting any response from the server, with logs showing GET 401 /auth/me errors. Problems with server on fly.io
4. CORS Issues: If you're getting CORS errors, it could be related to how your API endpoints are set up or how the CORS middleware is configured. Api.post on custom HTTP Endpoint results in CORS Error
To troubleshoot:
1. Check your server logs for any specific error messages, especially 401 errors.
2. Verify your environment variables, particularly those related to authentication and API URLs.
3. Try running the app locally to see if the issue persists.
4. If using fly.io, try redeploying the app and restarting the server.
If none of these steps resolve the issue, it might be worth opening a new issue on the Wasp GitHub repository with detailed information about your setup and the exact errors you're encountering.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @wbjb, 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?
@kapa.ai this is a local version. That's the issue it won't load the demo app
Let me check the knowledge base for you again. One moment! :books:
----------------------
Thank you for providing more context. Since you're running a local version and having issues loading the demo app, let's focus on troubleshooting the local setup. Based on the knowledge sources, here are some steps you can try:
1. Clean and Restart:
Try running
wasp clean
to remove all build artifacts, then restart your app with wasp start
. This can help resolve issues related to stale builds or cached data. Discord support thread
2. Check for Port Conflicts:
Ensure that nothing else is running on ports 3000 (frontend) and 3001 (backend). Sometimes, terminating the service using port 3001 and restarting the app can resolve connection issues. Discord support thread
3. Verify Node Version:
Make sure you're using a compatible Node.js version. Wasp typically works well with Node.js v18. You can check your version with node -v
. Discord support thread
4. Check for Module Errors:
If you're seeing errors like "Cannot find module 'wasp/server'", it might indicate that the Wasp compiler hasn't run properly. Try running wasp compile
manually to see if there are any specific errors. Discord support thread
5. Examine Browser Console:
Open your browser's developer tools and check the console for any specific error messages. This can provide valuable information about what's preventing the app from loading. Discord support thread
6. Review Environment Setup:
Ensure that your local environment is correctly set up, including any necessary environment variables. For the OpenSaaS template, check the .env.server
file and make sure it's properly configured. Discord support thread
If none of these steps resolve the issue, it would be helpful to share any specific error messages you're seeing in the terminal or browser console. This would allow for more targeted troubleshooting.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @wbjb, 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?To anyone reading... This is dicussed here: https://discord.com/channels/686873244791210014/1325484414557487124/1326112789819031574