Skip to content

Shopify Dude Fix

Shopify Theme Dev Shows 404s for Market Subfolders? Preview on the Primary Domain

Local Shopify CLI previews can misresolve market subfolders on stores with a custom primary domain. Verify the live-domain theme preview before rewriting routes.

Quick answer: If shopify theme dev returns a 404 for /en-us or renders untranslated content at /fr-ca, first compare the same unpublished theme on the store’s primary custom domain with ?preview_theme_id=. Shopify confirmed a November 2026 limitation in resolving market subfolders on non-primary preview domains. A broken localhost route does not necessarily mean your Markets configuration or translations are broken.
On this page

Why the same theme behaves differently

A market URL combines a domain, a country or market-specific path, and a locale. On a custom primary domain, Shopify can resolve /en-us and /fr-ca as market routes. The local 127.0.0.1 development host may instead treat the suffix as a language identifier, reject default-language prefixes, or fall back to untranslated merchant content. Shopify staff reproduced and acknowledged this behavior in the developer community on November 6, 2026.

That means a developer can spend hours modifying Liquid links or duplicating locale files to fix a preview-only problem. Don’t make production URL changes until you’ve compared equivalent routes.

Debug the route before changing code

  1. Record the primary domain, market web presences, enabled languages, and expected root paths in Shopify admin.
  2. Start shopify theme dev against the intended store and theme. Record the local URL, status, Shopify.locale, and Shopify.routes.root for each affected path.
  3. Open the same path on the primary custom domain with the development theme’s preview ID. Keep shopify theme dev running to synchronize edits; refresh the primary-domain preview manually.
  4. Compare product titles, navigation, translated merchant content, and generated URLs. If the primary-domain preview works, classify the local failure as a preview limitation rather than a live storefront defect.
  5. If both fail, investigate Markets web presence, published language, translation availability, and custom redirect logic. Check domain-level redirects separately from Shopify’s market routing.

Example comparison

Local preview:   http://127.0.0.1:9292/fr-ca
Domain preview:  https://example.com/fr-ca?preview_theme_id=123456789
Expected root:   /fr-ca/

Use your actual domain and theme ID. Do not paste a made-up theme ID into production instructions. On a storefront page, inspect Shopify.routes.root in the browser console and compare it with the expected market path. A working domain preview is a better test of routing than the local URL in this specific scenario, though it lacks local hot reload.

Common misunderstanding: A 404 in the CLI preview proves that the market’s subfolder is not configured. It may only prove that the local preview host cannot resolve the custom-domain market path. Conversely, a working preview does not prove your public market is published or indexed.
How to test this

  1. Test the default-language market subfolder and at least one translated subfolder locally.
  2. Repeat each path using the primary-domain preview of the same unpublished theme.
  3. Compare status code, locale, root URL, translated content, currency, and internal navigation.
  4. Test a product, collection, and cart link; verify they retain the intended market root.
  5. Test the published domain separately and document any differences before changing routing or translation files.