<@U04UQ68083H> for developing my custom UI I have ...
# ory-copilot
i
@chilly-king-10285 for developing my custom UI I have 2 test-projects to which I connect via the ory tunnel, lately one got broken and is now always thrown cors errors when trying to communicate with ory, what could I have changed thats causing the issue?
b
A message from kapa.ai
To address your question about CORS errors when using Ory Tunnel for custom UI development, there are a few potential causes and solutions to consider: 1. CORS Configuration: Ensure that you have properly configured CORS for your Ory Network project. You can do this in the Ory Console under the Custom Domains section. Make sure your development domain is listed in the allowed CORS origins. Remember that wildcards are allowed, but
*
,
null
, and
localhost/127.0.0.1
are not permitted [Set up CORS for Ory Network](https://www.ory.sh/docs/guides/cors). 2. Ory Tunnel Usage: When using Ory Tunnel for local development, make sure you're using the correct command and options. For example:
Copy code
ory tunnel --project <project-id> --allowed-cors-origins <https://your-dev-domain.com> <http://localhost:3000>
This command sets up the tunnel and explicitly allows CORS for your development domain [ory tunnel](https://www.ory.sh/docs/cli/ory-tunnel). 3. Project Configuration: Check if there have been any recent changes to your project configuration, especially related to CORS or custom domains. Ensure that your custom domain settings are correct if you're using them [Set up custom domains](https://www.ory.sh/docs/guides/custom-domains). 4. SDK Configuration: If you're using an Ory SDK, make sure it's up to date and properly configured. The newer versions of the SDK handle the API paths correctly for Ory Cloud [ory/network#124](https://github.com/ory/network/issues/124#issuecomment-1186644810). 5. Browser Cache: Sometimes, browser caching can cause persistent CORS issues even after fixing the configuration. Try clearing your browser cache or testing in an incognito/private browsing window. If none of these solutions resolve your issue, you may want to double-check your application code to ensure it's making requests to the correct Ory endpoints. Also, consider using the
--debug
flag with Ory Tunnel to get more detailed information about the CORS requests [ory tunnel options](https://www.ory.sh/docs/cli/ory-tunnel#options). If the problem persists, you might want to compare the configurations and setups of your working and non-working projects to identify any differences that could be causing the CORS errors.