Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: JSON templates are unformatted #4851

Closed
2 tasks done
JasonHassold opened this issue Nov 13, 2024 · 15 comments
Closed
2 tasks done

[Bug]: JSON templates are unformatted #4851

JasonHassold opened this issue Nov 13, 2024 · 15 comments
Labels
Area: @shopify/theme @shopify/theme package issues Type: Bug Something isn't working

Comments

@JasonHassold
Copy link

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

  1. shopify theme dev --theme-editor-sync
  2. Open the theme editor and save changes to a template
  3. 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

@JasonHassold JasonHassold added the Type: Bug Something isn't working label Nov 13, 2024
@JasonHassold
Copy link
Author

I don't think this issue is specific to the --theme-editor-sync flag, but that is what I was using

@max-techyscouts
Copy link

max-techyscouts commented Nov 14, 2024

When I run shopify theme pull -d, the json templates are not minified but when use shopify theme dev --theme-editor-sync, they are minified when I edit on theme customizer.

@gordonhirsch gordonhirsch added the Area: @shopify/theme @shopify/theme package issues label Nov 14, 2024
@mgmanzella
Copy link
Contributor

thanks for reporting folks! we have a fix in progress, will let you know when it's live

@mgmanzella
Copy link
Contributor

👋 we have a fix live for this issue, please let us know if it still persists. we have heard that JS files are being minified, which is separate from this issue

@mgmanzella
Copy link
Contributor

mgmanzella commented Nov 22, 2024

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

@lesterdefreitas
Copy link

@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?

@alexggmark
Copy link

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/[email protected]

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

@mgmanzella
Copy link
Contributor

@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

@lukeh-shopify
Copy link
Contributor

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

@lesterdefreitas
Copy link

@lukeh-shopify thanks again. So, this does not involve updating to a new cli version?

@lesterdefreitas
Copy link

@alexggmark thanks for taking the time to share your workaround btw. 🙏🏻

@lukeh-shopify
Copy link
Contributor

@lukeh-shopify thanks again. So, this does not involve updating to a new cli version?

No it does not, the fix was applied on the platform. However, I would recommend using the latest version anyway. Some older versions (as mentioned in the workaround) applied formatting within the CLI itself, or used endpoints on the platform that applied formatting a little differently

@JasonHassold
Copy link
Author

@mgmanzella @lukeh-shopify I just tried upgraded back to latest version v3.70.0, but have been having this error pretty much constantly now. I was not experiencing this before when I originally upgraded to v3.70.0 and was having the formatting issue. Maybe something else on the platform site was changed or maybe the fix for the formatting issue has caused this.

Image

@lukeh-shopify
Copy link
Contributor

@mgmanzella @lukeh-shopify I just tried upgraded back to latest version v3.70.0, but have been having this error pretty much constantly now. I was not experiencing this before when I originally upgraded to v3.70.0 and was having the formatting issue. Maybe something else on the platform site was changed or maybe the fix for the formatting issue has caused this.

Image

@JasonHassold this looks like a similar to a known issue that we're working on a fix for ASAP. Could you please post your verbose logs/reproduction steps in that issue? Sorry this happened to you, it must be frustrating

@mgmanzella
Copy link
Contributor

👋 closing this issue because it's resolved, @JasonHassold we'll follow up here on your polling issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: @shopify/theme @shopify/theme package issues Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants