Local theme dev via CLI: CORS errors on assets

Topic summary

Local Shopify theme development via CLI is blocked by CORS (Cross-Origin Resource Sharing) when loading assets through the CDN (Content Delivery Network), causing most internal resources (e.g., items under assets) to be refused in the browser. Pushing to the live store shows assets correctly, but that workflow is counter-productive for local development.

Requested actions:

  • A way to bypass CORS locally without disabling it in the browser.
  • Documentation on where the CLI’s internal server is configured, to add an .htaccess (web server config) and set headers that disable/adjust CORS at the domain level.
  • A bug was filed with Shopify CLI (GitHub issue linked).

Recent update:

  • Fonts-related CORS issues appear addressed in Shopify CLI 3.23.0.

Status:

  • Partial resolution (fonts fixed). Broader CORS blocks for other assets remain unspecified, with no documented server path or .htaccess guidance provided. The discussion is ongoing and lacks a comprehensive local workaround beyond the browser-level change (which is undesirable).
Summarized with AI on February 4. AI used: gpt-5.

While working on theme development locally,
Almost all internal resources that pass through the CDN (so essentially any item linked from assets) is being blocked as a cross-origin request.

Can’t find much in the way of documentation on how to bypass this short of turning it off for the browser, which is most definitely not desirable.

Luckily you can see the correct items when you do a push, but having to push to see your changes on the actual store is counter-productive to local development.

Wondering if anyone has a fix for this.

Particularly, I’d love to see information on where the cli sets up the internal server so that an .htaccess can be added to disable CORS at the domain level and not the browser level.

It would also be nice if such info were to be added to the documentation where it should live…

Also flagged this as a bug for cli. Where hopefully by poking through code I can sort out where to add the .htaccess…
https://github.com/Shopify/shopify-cli/issues/2678

The issue for fonts seems to have been addressed on Shopify CLI version: 3.23.0