cli: [Bug]: JSON templates are unformatted
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
JSON template files and settings_data.json file should be formatted correctly.
Actual behavior
I just upgraded to Shopify CLI version 3.70.0 and started working on a theme using shopify theme dev --theme-editor-sync and the templates I save in the theme editor are pulling in unformatted in 1 line with no new lines or indentation. I looked in the theme code editor on shopify and the files look correctly formatted there.
Verbose output
N/A
Reproduction steps
shopify theme dev --theme-editor-sync- Open the theme editor and save changes to a template
- Look at that template locally after it pulls in
Operating System
Ubuntu 20.04.6 LTS on WLS 2 on Windows 11
Shopify CLI version (check your project’s package.json if you’re not sure)
3.70.0
Shell
No response
Node version (run node -v if you’re not sure)
No response
What language and version are you using in your application?
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 15 (8 by maintainers)
Hi all, the fix has been enabled again for all stores and your JSON files should be formatted again on the latest CLI version. Please let us know if you encounter any other issues
hi folks, we’ve had to rollback this fix for everyone but we can enable it for specific stores, if you’re experiencing this issue pls DM me in the partners slack at Morisa Manzella with your store url and ill enable it so you can successfully track changes
thanks for your patience, we’ll have a fix for everyone very soon
Having identical issue, but I was messing around with VSCode/Terminal over weekend and took me ages to realise it was a Shopify CLI issue.
Probably not ideal, but the workaround for me was reverting to older CLI version @lesterdefreitas
npm uninstall -g @shopify/cli
npm install -g @shopify/cli@3.66.1
Cycled through a few versions, 3.66.1 seems to have the fewest issues - although this is a very hacky fix and probably not best practice.
You can find a full list of Shopify CLI versions here: https://www.npmjs.com/package/@shopify/cli?activeTab=versions
👋 closing this issue because it’s resolved, @JasonHassold we’ll follow up here on your polling issue
@alexggmark thanks for taking the time to share your workaround btw. 🙏🏻
@lesterdefreitas we’re working on getting this fix out again asap, this is purely to hold you over so you don’t lose your diffs. @alexggmark workaround sounds like a good option if youre not on the partners slack
@mgmanzella I’m not on slack, can you please enable the fix for me somehow? Problem is I am working on tons of stores. Must I list each one for you?
Or, is there an easy way for me to roll back to an earlier cli version to avoid this?
thanks for reporting folks! we have a fix in progress, will let you know when it’s live