cli: [Bug]: --theme-editor-sync running infinite loop
Please confirm that you have:
- 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.)
- 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 --store --theme-editor-sync should sync once on start.
Actual behavior
Sync gets stuck in an infinite loop:
Verbose output
Sorry, but --verbose runs in an infinite loop when combined with --theme-editor-sync. I'm not exactly sure what to paste here.
Reproduction steps
shopify theme dev --store --theme-editor-sync
Operating System
macOS Sonoma 14.5
Shopify CLI version
3.62.0
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 22 (3 by maintainers)
Commits related to this issue
- add a trailing comma to avoid infinite sync loop https://github.com/Shopify/cli/issues/4107#issuecomment-2181624309 — committed to taro-arumakan/archive-epke-dawn by taro-arumakan 2 years ago
+1, same. Seeing infinite loops on
settings_schema.jsonOddly, adding a trailing comma to the last item in our settings array in
settings_schema.jsonseems to fix the issue 🤔 (found this clue on another thread)@shopify/cli/3.59.3 darwin-arm64 node-v22.0.0As a note, something really does need to be done about this, because most code editors these days do auto formatting of files, which does not support the trailing comma as its not part of the spec of JSON. This is causing a massive headache of having to manually copy files when making changes, rather than letting the CLI handle those changes
Thank you for sharing that, @lesterdefreitas! I’ve also noticed a similar scenario here.
My original PR, unfortunately, missed a detail related to
assets/*files. The fix for that is applied here, so we may expect that to be resolved in a new CLI release soon.👋 Hey everyone,
Thank you for your input and all the details about this issue. We’ve released a new version of the Shopify CLI some minutes ago with the fix (
3.63.2). Please, if this problem persists, don’t hesitate to reach out and share your--verboseoutput here.Thanks again for reporting!
I too have this issue again. I got hundreds of json files going crazy. Impossible to use the CLI like that. It’s been months and still no permanent fix was found, lame!
Here is a node script I placed in a .app folder in my project to add the trailing commas at the end of every json files. Could be better but does the job, and why in the first place do we have to go through this again? Make sure you use git to check the local changes.
this got my Vite assets/manifest.json file too, same endless loop, trailing comma fixed 😕
+1, same issue after updating to 3.62.0