CORS Errors
If you are experiencing connection issues when trying to access your Medusa application from a storefront or the admin dashboard, it is most likely due to Cross-Origin Resource Sharing (CORS) issues.
You might see a log in your browser console, that looks like this:
In your medusa-config.ts
, ensure that you've configured your CORS settings correctly:
1module.exports = defineConfig({2 projectConfig: {3 http: {4 storeCors: process.env.STORE_CORS || "http://localhost:8000",5 adminCors: process.env.ADMIN_CORS || "http://localhost:9000",6 authCors: process.env.AUTH_CORS || "http://localhost:8000,http://localhost:9000",7 },8 // ...9 },10})
Learn more about these configurations in this documentation.
Was this page helpful?