W
Wasp3mo ago
nitish30

CORS error on gitpod

Access to XMLHttpRequest at 'https://3001-nitishymtpl-helm-3ff7gtw693e.ws-us116.gitpod.io/auth/me' from origin 'https://3000-nitishymtpl-helm-3ff7gtw693e.ws-us116.gitpod.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Hi, I am receiving above error on gitpod. I have made corresponding changes in .env.client and .env.server file. Pls let me know the way to fix this issue.
5 Replies
kapa.ai
kapa.ai3mo ago
Hi @nitish30. 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, it seems like you're experiencing a CORS (Cross-Origin Resource Sharing) issue. This typically happens when a web application tries to access resources from a different origin (domain, protocol, or port) from its own. In your case, it seems like your Wasp application running on Gitpod is trying to access resources from a different port, which is causing the CORS issue. Here are a few steps you can take to resolve this issue: 1. Ensure that you have correctly set the environment variables in your .env.server and .env.client files. In your .env.server file, you should have the WASP_WEB_CLIENT_URL variable set to your client URL on Gitpod. In your .env.client file, you should have the REACT_APP_API_URL variable set to your server URL on Gitpod. Here is an example of how you might set these variables: .env.server
WASP_WEB_CLIENT_URL=<https://3000-nitishymtpl-helm-3ff7gtw693e.ws-us116.gitpod.io>
WASP_WEB_CLIENT_URL=<https://3000-nitishymtpl-helm-3ff7gtw693e.ws-us116.gitpod.io>
.env.client
REACT_APP_API_URL=<https://3001-nitishymtpl-helm-3ff7gtw693e.ws-us116.gitpod.io>
REACT_APP_API_URL=<https://3001-nitishymtpl-helm-3ff7gtw693e.ws-us116.gitpod.io>
2. If you have correctly set these environment variables and are still experiencing the issue, it might be helpful to restart your Gitpod instance. 3. If the issue persists, it might be helpful to share your Gitpod app with a member of the Wasp community so they can help debug the issue. For more detailed information, you can refer to this Discord support thread (https://discord.com/channels/686873244791210014/1217758453326680095) where a similar issue was discussed. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @nitish30, 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?
martinsos
martinsos3mo ago
I am afraid our gitpod situation might be somewhat outdated. How did you end up creating a Wasp app on Gitpod? I thought we removed mention of it from the docs
nitish30
nitish30OP3mo ago
Hi @martinsos . It is working now.
martinsos
martinsos3mo ago
@nitish30 all right! Do you know what the cause was? Oh and question still stands, how did you end up with Wasp on Gitpod?
nitish30
nitish30OP3mo ago
Hey the issue was CORS. I opened the port. Gitpod is more convenient for rapid development.
Want results from more Discord servers?
Add your server