Joint session with Vercel: How to build intelligent storefronts (May 15th)

CORS wildcard subdomain not working with Netlify domain

4 repliesLast updated: Dec 2, 2025

hi, i’m having trouble adding a CORS origin with a wildcard to a new project. When i enter
https://*<http://my-project-name.netlify.app|my-project-name.netlify.app>
I get an error: “Unable to parse URL”. I’ve been able to successfully do this in the past (to target Netlify branch deploys)
AI Update

I can see you're getting the "Unable to parse URL" error when trying to add a wildcard CORS origin for your Netlify branch deploys. Good news - Sanity does support wildcard CORS origins, but the format needs to be exact.

Based on the official Sanity CORS documentation, wildcards (*) are allowed in CORS origins. For Netlify branch deploys, the correct format should be:

https://*.my-project-name.netlify.app

Note the placement: https://* followed directly by .your-domain (no space, no extra characters).

Troubleshooting Your "Unable to parse URL" Error

If you're entering the wildcard correctly and still getting this error, here are some things to check:

How to Add CORS Origins

You can configure CORS origins in two ways:

Via Management Dashboard:

Via Sanity CLI:

sanity cors add https://*.my-project-name.netlify.app --credentials

If the dashboard is giving you trouble, try the CLI method as an alternative.

Netlify-Specific Considerations

Netlify branch deploys use the pattern https://branch-name--site-name.netlify.app, so the wildcard https://*.my-project-name.netlify.app should cover all your branch deploys perfectly.

Don't forget to also add http://localhost:3000 (or your local dev port) for local development work.

If you're still encountering the parsing error after verifying the format, there may be a temporary issue with the Management Dashboard. In that case, definitely try the CLI method or reach out to Sanity support through the Community Slack for direct assistance.

Show original thread
4 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions