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:

CORS error log

In your medusa-config.ts, ensure that you've configured your CORS settings correctly:

medusa-config.ts
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?
Ask Anything
Ask any questions about Medusa. Get help with your development.
You can also use the Medusa MCP server in Cursor, VSCode, etc...
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break