[Bug]: Shopify CLI keeps refreshing when theme-editor-sync = true
Please confirm that you have:
- [X] Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
- [X] Reproduced the issue in the latest CLI version.
In which of these areas are you experiencing a problem?
Theme
Expected behavior
Running shopify theme dev --theme-editor-sync should start the live-preview server, and update code within the dev customizer in both directions.
Actual behavior
Despite having the same templates/index.json file locally and on the development theme, a choice appears:
The local file templates/index.json is different from the remote version in the development theme.
? What would you like to do? (Choose with ↑ ↓ ⏎, filter with 'f')
> 1. Keep the remote version
2. Keep the local version
3. Merge files (it may break the local file)
4. Exit
Verbose output
Whatever choice is used, the live-preview gets stuck in an infinite get/update loop:
• 11:13:25 Synced » get templates/index.json
• 11:13:26 Synced » update templates/index.json
• 11:13:29 Synced » get templates/index.json
• 11:13:29 Synced » update templates/index.json
• 11:13:32 Synced » get templates/index.json
• 11:13:33 Synced » update templates/index.json
• 11:13:36 Synced » get templates/index.json
• 11:13:36 Synced » update templates/index.json
and so on
Reproduction steps
This happens on a specific store, but not on others. Will be hard to reproduce on a different store, as I don't know the cause of the issue.
Operating System
Ubuntu 20.04
Shopify CLI version (check your project's package.json if you're not sure)
@shopify/cli/3.53.0
Shell
bash
Node version (run node -v if you're not sure)
node-v18.19.0
What language and version are you using in your application?
No response
Trying to solve this issue, I made a clean installation of my dev environment with all the latest versions of everything. The issue still persists for this specific merchant.
Ubuntu 22.04 Node v21.5.0 Shopify CLI 3.53.0
There's nothing special within their templates/index.json that might explain this infinite loop.
I'm facing the identical issue with the following:
- Operating System: Ubuntu 23.04
- Node.js version: v21.5.0
- Shopify CLI version: Tested with both 3.52.0 and 3.53.0
Same issue on Apple M1, MacOS 14.2.1 since Shopify CLI version 3.52.0
@ahmedbm27 @iPhenan I found a temporary bandaid, if the issue is related to a single file like me. You can add flag ignore = ["templates/index.json"] (or whatever file is problematic) and you'll be able to use customizer sync again (except the ignored file)
I recently had this within the team. For us it was Unicode hiding in plain sight. A U+2028 LINE SEPARATOR character got inserted when copying multiline text from, e.g., Figma, into a single-line text box in the theme editor. Getting rid of the extra 'invisible' Unicode characters causes the loop to stop for us.
The loop also happens if U+2028 is inserted unescaped. It won't show up in VS Code, however on opening the file for the first time you should get prompted to ignore or remove the LS/PS characters.
I recently had this within the team. For us it was Unicode hiding in plain sight. A U+2028 LINE SEPARATOR character got inserted when copying multiline text from, e.g., Figma, into a single-line text box in the theme editor. Getting rid of the extra 'invisible' Unicode characters causes the loop to stop for us.
The loop also happens if U+2028 is inserted unescaped. It won't show up in VS Code, however on opening the file for the first time you should get prompted to ignore or remove the LS/PS characters.
@StanAngeloff
You're right! I deleted the Unicode U+2028 from the template JSON file, which helped us stop the infinite loop.Thank you!
@StanAngeloff Nice catch! Same issue here, I'd have never seen it otherwise. Thanks!
Shopify Team, still feel like this is a bug that should be fixed, as it's fairly common to copy/paste text from Figma. Maybe through an error message like the ones thrown when invalid schema is detected during a dev session?
I recently had this within the team. For us it was Unicode hiding in plain sight. A U+2028 LINE SEPARATOR character got inserted when copying multiline text from, e.g., Figma, into a single-line text box in the theme editor. Getting rid of the extra 'invisible' Unicode characters causes the loop to stop for us.
The loop also happens if U+2028 is inserted unescaped. It won't show up in VS Code, however on opening the file for the first time you should get prompted to ignore or remove the LS/PS characters.
it worked 🎉🎉 Thanks aloooot
@StanAngeloff I love you. Definitely would not have found that and this was driving me mad. And I agree with @jpallard6120 -- an error message would be great otherwise there's no way to know what's happening.
Worked for me thank you for the fix @StanAngeloff
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.
@shopify-admins I feel this still warrants a bug fix!
Just ran into this issue too
Also having this issue
Still having this issue too.
Facing the exact same issue and don't have any unicode chars in my files.
Having this as well, should definitely be fixed.
A temporary solution I found when this happens is to empty the file that is stuck in an infinite loop (copy to clipboard) => save file => paste the file content => save.
Still having this issue too.
Add -x *.context.* in your command to exclude those locale templates from your hot reload.
So your cli dev command will look something like shopify theme dev --theme-editor-sync -x *.context.*
Still facing issues with this also. Although MaxDesignFR's temporary fix seems to do the job. Any news on a permanent solution from the Shopify team?
👋 Hey everyone,
If you're still facing this issue, could you please share your --verbose logs, ideally sharing the content of the JSON asset involved in the loop? With that, the assignee of this issue will be able to reproduce the exact scenario you're facing and fix it.
Thanks a lot for reporting!
@karreiro Here's my verbose log (is this what you meant?) scratch_6.txt
The reload loop is caused by these unicode characters in settings_data.json. I'd be happy to share the entire file privately.
A temporary solution I found when this happens is to empty the file that is stuck in an infinite loop (copy to clipboard) => save file => paste the file content => save.
Thanks for this! I just wanted to note that this is indeed a temporary solution. Once you end restart the syncing process, the error recurs with the same files as before (at least it does for me). But at least I can fix the issue for a single working session!
Just to keep the post alive, I'm facing the same error in settings_schema.json. Can confirm also that the temporary solution works
I haven't found any bad characters, but it is running "get" and "update" for config/settings_schema.json. I've checked with the Gremlins extension in VS Code - there seems to be no problem with the file. I've tried the copy/paste thing, but that has no effect. It is getting and updating every 1-3 seconds. I also just updated to the latest CLI version, so this has happened in 3.57 and 3.62.
I've been experiencing this on several merchants in the recent past (~4mo).
I've been able to come up with a replicable scenario in CLI 3.62.0 that doesn't seem to be related to the use cases above, but nonetheless causes the same endless loop issue:
- Create a
settings_schema.jsonfile with the following content:
[
{
"name": "theme_info",
"theme_name": "Blank",
"theme_version": "1.0.0",
"theme_author": "RunDTC",
"theme_documentation_url": "https://help.shopify.com/manual/online-store/themes",
"theme_support_url": "https://support.shopify.com/"
}
]
- Observe/confirm that there are no hidden unicode characters in that file.
- Upload the above by running
shopify theme dev. Confirm that no errors are reported, and stop the command (^C). - Run
shopify theme dev --theme-editor-sync. Confirm that output displays in an endless loop ofgetandupdateonconfig/settings_schema.json; any changes made and saved to that file locally get immediately overwritten. - Stop running command. Add a comma after the closing curly bracket:
[
{
"name": "theme_info",
"theme_name": "Blank",
"theme_version": "1.0.0",
"theme_author": "RunDTC",
"theme_documentation_url": "https://help.shopify.com/manual/online-store/themes",
"theme_support_url": "https://support.shopify.com/"
},
]
- Upload the above by running
shopify theme dev. Confirm that no errors are reported. - Run
shopify theme dev --theme-editor-sync. Confirm that there is no endless loop of getting/updatingconfig/settings_schema.json
This one's a bit weird, because strict adherence to the JSON spec in settings/locales/templates is required to avoid upload errors on Shopify; but in this case an extra comma prevents this endless loop.
This is also an edge case, because a mostly empty config/settings_schema.json is not likely on any merchant. But I'm hoping that a replicable version of this might help identify the underlying issue.
I haven't found any bad characters, but it is running "get" and "update" for config/settings_schema.json. I've checked with the Gremlins extension in VS Code - there seems to be no problem with the file. I've tried the copy/paste thing, but that has no effect. It is getting and updating every 1-3 seconds. I also just updated to the latest CLI version, so this has happened in 3.57 and 3.62.
I have exactly the same issue at the moment. Not with all project, but just some.
What I also found out is that if I go to my folder where the shopify files are living (./theme) in this case and then run the command, it works fine. But as soon as that I run the command from the root with --path ./theme, it will give me this error.
@visnaut Hey, that seems to work for me, too! Funny, they just announced support for trailing commas, but didn't say they might be necessary, lol. In any case, thanks!
Hi @karreiro,
Do you have an email address that I could send the verbose logs to? I'm not allowed to share this publicly.
From what I see is that it doesn't really show anything relevant except for the API that is actually using the unstable API under the hood.
Thanks!
:wave: Hey @stijns96,
Yeah, please, feel free to DM me in Partners Slack.
If you could send the --verbose log and one file that’s getting into the synchronization loop, that may help us on identifying the exact issue you’re facing.
Thanks a lot!


