I have created contextual templates in for different markets on my website. When trying to add more changes, I get an error: “Failed to create contextual templates. Please try again.” Then the editor resets back to the default market. I am editing these templates in themes>customize. Is this a known issue? Started happening just now.
Topic summary
-
Issue: Editing market-specific contextual templates in Themes > Customize fails with the error “Failed to create contextual templates. Please try again.” The editor reverts to the default market.
-
Impact: Reported by multiple users, occurring when adding changes or creating contextual templates for other markets.
-
Root cause (community finding): Template filenames hit Shopify’s maximum character limit. When a context is added, Shopify appends a suffix like “context.us” or “context.b2b,” which can push already-long filenames over the limit and block automatic creation.
-
Workaround/Fix: Shorten the original template filename, then switch markets/create the contextual template. Creating a contextual template manually via Edit Code surfaced the cause and also works if the name stays within the limit.
-
Status: A practical workaround exists. No confirmation that this is an acknowledged Shopify bug or that a platform-side fix is planned.
I am having the same problem. Anybody got a solution??
I stumbled across the solution to this issue by attempting to create a contextual template manually in the ‘Edit Code’ section.
There are 2 contributors to this error message:
- A long template name
- Adding a ‘context’ appends ‘context.us’ or ‘context.b2b’ to the template name
Due to the a Shopify-imposed max character limit on template names, the automatic creation of contextual template can’t happen when the original filename is already too long.
SOLUTION: shorten your original template name, then proceed with switching markets.