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]: Shopify CLI keeps refreshing when theme-editor-sync = true #3222

Closed
2 tasks done
jpallard6120 opened this issue Jan 3, 2024 · 50 comments · Fixed by #4142 or #4160
Closed
2 tasks done

[Bug]: Shopify CLI keeps refreshing when theme-editor-sync = true #3222

jpallard6120 opened this issue Jan 3, 2024 · 50 comments · Fixed by #4142 or #4160
Assignees
Labels
Area: @shopify/theme @shopify/theme package issues #gsd:40767 Fortify local development experience for Liquid themes moderate lowest severity for theme related bug Type: Bug Something isn't working

Comments

@jpallard6120
Copy link

jpallard6120 commented Jan 3, 2024

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

@jpallard6120 jpallard6120 added the Type: Bug Something isn't working label Jan 3, 2024
@jpallard6120
Copy link
Author

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.

@isaacroldan isaacroldan added the Area: @shopify/theme @shopify/theme package issues label Jan 4, 2024
@ahmedbm27
Copy link

ahmedbm27 commented Jan 4, 2024

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

@iPhenan
Copy link

iPhenan commented Jan 4, 2024

Same issue on Apple M1, MacOS 14.2.1 since Shopify CLI version 3.52.0

@jpallard6120
Copy link
Author

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

@StanAngeloff
Copy link

StanAngeloff commented Jan 10, 2024

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.

image

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.

@ahmedbm27
Copy link

ahmedbm27 commented Jan 10, 2024

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.

image

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!

@jpallard6120
Copy link
Author

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

@developersaintt
Copy link

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.

image

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

@diegovogel
Copy link

diegovogel commented Feb 9, 2024

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

@DannyTaki
Copy link

Worked for me thank you for the fix @StanAngeloff

Copy link
Contributor

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.

@jpallard6120
Copy link
Author

@shopify-admins I feel this still warrants a bug fix!

@JasonHassold
Copy link

Just ran into this issue too

@jdunham2
Copy link

Also having this issue

@ceri-waterscreative
Copy link

Still having this issue too.

image

@rahulbhanushali
Copy link

Facing the exact same issue and don't have any unicode chars in my files.

@patrickdmccarthy
Copy link

Having this as well, should definitely be fixed.

@mgmanzella mgmanzella added the open for contributions theme bugs that won't be prioritized in the near future label May 16, 2024
@MaxDesignFR
Copy link

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.

@rightgeek
Copy link

rightgeek commented May 17, 2024

Still having this issue too.

image

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.*

@RyanBriggsRCA
Copy link

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?

@karreiro
Copy link
Contributor

👋 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!

@diegovogel
Copy link

@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.
Screen Shot 2024-05-31 at 2 41 08 PM

@mgmanzella mgmanzella added #gsd:40767 Fortify local development experience for Liquid themes moderate lowest severity for theme related bug and removed open for contributions theme bugs that won't be prioritized in the near future labels Jun 7, 2024
@visnaut
Copy link

visnaut commented Jun 19, 2024

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:

  1. Create a settings_schema.json file 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/"
  }
]
  1. Observe/confirm that there are no hidden unicode characters in that file.
  2. Upload the above by running shopify theme dev. Confirm that no errors are reported, and stop the command (^C).
  3. Run shopify theme dev --theme-editor-sync. Confirm that output displays in an endless loop of get and update on config/settings_schema.json; any changes made and saved to that file locally get immediately overwritten.
  4. 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/"
  },
]
  1. Upload the above by running shopify theme dev. Confirm that no errors are reported.
  2. Run shopify theme dev --theme-editor-sync. Confirm that there is no endless loop of getting/updating config/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.

@stijns96
Copy link

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.

@surfwoodroad
Copy link

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

@stijns96
Copy link

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!

@karreiro
Copy link
Contributor

👋 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!

@danielgivens
Copy link

@visnaut this worked for my situation as well, except for me it was manifest.json. Thanks for sharing.

@modulareverything
Copy link

modulareverything commented Jun 24, 2024

I'm having this issue too:

  • 10:04:27 Synced » get config/settings_schema.json
  • 10:04:28 Synced » update config/settings_schema.json
  • 10:04:31 Synced » get config/settings_schema.json
  • 10:04:32 Synced » update config/settings_schema.json
  • 10:04:35 Synced » get config/settings_schema.json
  • 10:04:35 Synced » update config/settings_schema.json

If I open settings_schema.json I can see there's an error due to a missing label on a font_picker, but if I add the label field back in it will still fetch the broken schema file from the server and then start the infinite loop again.

Edit: Tried deleting the remote theme (shopify theme list and find the theme ID, then shopify theme delete --theme <id> but it then gives me this error:

  404
  • 10:08:30 ERROR  » get config/settings_schema.json:

The fix in the end was to add a trailing comma to my settings_schema.json file, as pointed out by @visnaut and also here: #4107 (comment)

@jenadam
Copy link

jenadam commented Jun 25, 2024

Had same exact issue with settings_schema.json and confirming only adding the trailing comma fixed it.

    {
        "type": "color_scheme",
        "id": "cart_color_scheme",
        "label": "t:sections.all.colors.label",
        "default": "scheme-1"
      },
    ]
  }
]

@ArchieTandM
Copy link

get this issue still too, only since the latest CLI update though

@gokaka-stsys
Copy link

gokaka-stsys commented Jun 26, 2024

I updated shopify CLI to version 3.63.0, and also got keeping get&update issue.

❯ shopify theme dev --theme-editor-sync --verbose
...
/opt/homebrew/Cellar/shopify-cli/3.63.0/libexec/lib/node_modules/@shopify/cli/dist/assets/cli-ruby/bin/shopify:15: warning: base64 was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add base64 to your Gemfile or gemspec.
DEBUG GET https://{theme_id}/admin/api/unstable/themes.json with request_id: f7f49b4e-183a-4074-b854-be6f7980e6ac-1719426963
* Syncing theme #{theme_id} on {store_name}.myshopify.com
DEBUG GET https://{store_name}.myshopify.com/admin/api/unstable/themes/{theme_id}/assets.json with request_id: e42d196c-40cb-4f31-b5a8-312a8671216c-1719426963
DEBUG update config/settings_schema.json
DEBUG PUT https://{store_name}.myshopify.com/admin/api/unstable/themes/{theme_id}/assets.json with request_id: 8e0508a8-f125-4513-b877-92687cbe85c3-1719426964
[2024-06-26 14:36:04] INFO  WEBrick 1.7.0
[2024-06-26 14:36:04] INFO  ruby 3.3.3 (2024-06-12) [arm64-darwin23]
[2024-06-26 14:36:04] INFO  WEBrick::HTTPServer#start: pid=72760 port=9292
DEBUG GET https://{store_name}.myshopify.com/admin/api/unstable/themes/{theme_id}/assets.json with request_id: f79b926f-649c-4e60-9e7c-340e1e7a8979-1719426964
DEBUG get config/settings_schema.json
DEBUG GET https://{store_name}.myshopify.com/admin/api/unstable/themes/{theme_id}/assets.json?asset%5Bkey%5D=config%2Fsettings_schema.json with request_id: 6f333ac5-a0ec-45de-b1b6-a4276d95d818-1719426964
  • 14:36:04 Synced » get config/settings_schema.json
DEBUG [HotReload] Modified config/settings_schema.json
DEBUG update config/settings_schema.json
DEBUG PUT https://{store_name}.myshopify.com/admin/api/unstable/themes/{theme_id}/assets.json with request_id: 9bb6af55-8b49-4963-b89c-cfb387624239-1719426965
  • 14:36:05 Synced » update config/settings_schema.json
DEBUG GET https://{store_name}.myshopify.com/admin/api/unstable/themes/{theme_id}/assets.json with request_id: 407d5075-6366-4433-94ab-bafe5ac832ab-1719426968
DEBUG get config/settings_schema.json
DEBUG GET https://{store_name}.myshopify.com/admin/api/unstable/themes/{theme_id}/assets.json?asset%5Bkey%5D=config%2Fsettings_schema.json with request_id: 4c18d9a8-88f2-430d-8db0-8ed0fb40b5b8-1719426968
  • 14:36:08 Synced » get config/settings_schema.json
DEBUG [HotReload] Modified config/settings_schema.json
DEBUG update config/settings_schema.json
...

Currently, I have to theme dev without --theme-editor-sync, and manually watch and pull those JSON files as a workaround.

❯ watch -n 10 shopify theme pull -o config/*.json --theme {theme_id}

@rcasimmons
Copy link

Can confirm I get this also - constantly get/update of settings_schema.json. The temp. fix of cutting the contents, saving, pasting and then resaving works but only for that CLI session.

Really a shame that CLI has seen a decrease in quality over these past updates.

@CatalinGheorghiu
Copy link

Can confirm I get this also - constantly get/update of settings_schema.json. The temp. fix of cutting the contents, saving, pasting and then resaving works but only for that CLI session.

Really a shame that CLI has seen a decrease in quality over these past updates.

You just need to add a trailing comma as someone suggested already here. it's part of shopify's comment in json thing

@JamiesonRoberts
Copy link

As 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.

Just "add a trailing comma" is not really a solution when so many tools these days do things to help ensure standards are being followed.

@rcasimmons
Copy link

As 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.

Just "add a trailing comma" is not really a solution when so many tools these days do things to help ensure standards are being followed.

100% agree.

It's ok saying this but it's not fixing what is clearly the wider issue.

@karreiro is there any update from the team on this? It's been marked as Prioritized but with what seems to be no progress made.

@Kadreev
Copy link

Kadreev commented Jun 28, 2024

The same scenario occurred with us, involving three computers at our office. The "trailing comma" fix worked well on "settings_schema.json," but not for "assets/manifest.json," which we were forced to delete to continue development with the live editor sync enabled. Let me know if we can help.

@pablogiralt
Copy link

Same issue here with settings schema. Adding comma fixes the issue for us too

@rcasimmons
Copy link

@karreiro

Appreciate your input here - thanks for actioning this in your latest PR.

What version should we look out for and how long before we should expect this to be merged?

@karreiro
Copy link
Contributor

karreiro commented Jul 3, 2024

👋 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 --verbose output here.

Thanks again for reporting!

@jpallard6120
Copy link
Author

@karreiro Issue seems to be fixed for settings_schema.json for me! Thanks!

I have one store still stuck in a loop, but it's due to an app file, so it might not be relevant for Shopify CLI. Sharing the verbose logs just in case:

DEBUG GET https://fondussimo-dev.myshopify.com/admin/api/unstable/themes.json with request_id: 4fa01f69-374c-42bc-9699-bbdd830fdd60-1720014708
* Syncing theme #169819767075 on fondussimo-dev.myshopify.com
DEBUG GET https://fondussimo-dev.myshopify.com/admin/api/unstable/themes/169819767075/assets.json with request_id: 4b4958f6-56a0-4526-a728-682e7b8b709d-1720014708

The local file assets/pandectes-settings.json is different from the remote version in the development theme.
? What would you like to do? (You chose: Keep the local version)
DEBUG update assets/pandectes-settings.json                                                                                                                                               
DEBUG PUT https://fondussimo-dev.myshopify.com/admin/api/unstable/themes/169819767075/assets.json with request_id: 262c921d-f083-4b93-a7c2-197ff724648a-1720014713                        
                                                                                                                                                                                      100%
DEBUG update assets/pandectes-settings.json                                                                                                                                               
[2024-07-03 09:51:53] INFO  WEBrick 1.7.0
[2024-07-03 09:51:53] INFO  ruby 3.0.2 (2021-07-07) [x86_64-linux-gnu]
[2024-07-03 09:51:53] INFO  WEBrick::HTTPServer#start: pid=8817 port=9292
DEBUG PUT https://fondussimo-dev.myshopify.com/admin/api/unstable/themes/169819767075/assets.json with request_id: ba9647da-b832-4dec-9c51-1c37c5d88c9f-1720014714
  • 09:51:54 Synced » update assets/pandectes-settings.json
DEBUG GET https://fondussimo-dev.myshopify.com/admin/api/unstable/themes/169819767075/assets.json with request_id: d9dbfad9-12b6-4eee-903e-18994070ffb0-1720014714
DEBUG get assets/pandectes-settings.json
DEBUG GET https://fondussimo-dev.myshopify.com/admin/api/unstable/themes/169819767075/assets.json?asset%5Bkey%5D=assets%2Fpandectes-settings.json with request_id: 705750c0-4de8-4785-9363-e1cbd3225a14-1720014714
  • 09:51:54 Synced » get assets/pandectes-settings.json
DEBUG [HotReload] Modified assets/pandectes-settings.json
DEBUG update assets/pandectes-settings.json
DEBUG PUT https://fondussimo-dev.myshopify.com/admin/api/unstable/themes/169819767075/assets.json with request_id: d0c500d3-adb0-47c7-bad3-0290c4b7e9da-1720014714
  • 09:51:54 Synced » update assets/pandectes-settings.json
DEBUG GET https://fondussimo-dev.myshopify.com/admin/api/unstable/themes/169819767075/assets.json with request_id: 23e43296-d8b7-411e-9b01-e7319a83ccea-1720014717
DEBUG get assets/pandectes-settings.json
DEBUG GET https://fondussimo-dev.myshopify.com/admin/api/unstable/themes/169819767075/assets.json?asset%5Bkey%5D=assets%2Fpandectes-settings.json with request_id: bbcde84e-fdfa-4520-8cd1-a5badd9da73e-1720014717
  • 09:51:57 Synced » get assets/pandectes-settings.json
DEBUG [HotReload] Modified assets/pandectes-settings.json
DEBUG update assets/pandectes-settings.json
DEBUG PUT https://fondussimo-dev.myshopify.com/admin/api/unstable/themes/169819767075/assets.json with request_id: 83976495-4c1c-4f04-b3f0-36d38e900ec9-1720014718
  • 09:51:58 Synced » update assets/pandectes-settings.json
DEBUG GET https://fondussimo-dev.myshopify.com/admin/api/unstable/themes/169819767075/assets.json with request_id: 7d9b0452-f558-4490-a154-e4be717cf80c-1720014721
DEBUG get assets/pandectes-settings.json
DEBUG GET https://fondussimo-dev.myshopify.com/admin/api/unstable/themes/169819767075/assets.json?asset%5Bkey%5D=assets%2Fpandectes-settings.json with request_id: 24d04172-273a-4286-814d-baa808fb5e76-1720014721
  • 09:52:01 Synced » get assets/pandectes-settings.json
DEBUG [HotReload] Modified assets/pandectes-settings.json
DEBUG update assets/pandectes-settings.json
DEBUG PUT https://fondussimo-dev.myshopify.com/admin/api/unstable/themes/169819767075/assets.json with request_id: a4577280-ee14-4398-bd33-86832c841625-1720014721
  • 09:52:01 Synced » update assets/pandectes-settings.json
DEBUG GET https://fondussimo-dev.myshopify.com/admin/api/unstable/themes/169819767075/assets.json with request_id: 6a8b846f-2944-4017-ba61-1777a7bf159e-1720014724
DEBUG get assets/pandectes-settings.json
DEBUG GET https://fondussimo-dev.myshopify.com/admin/api/unstable/themes/169819767075/assets.json?asset%5Bkey%5D=assets%2Fpandectes-settings.json with request_id: 79465356-c77a-435d-a2e4-759e07131463-1720014725
  • 09:52:04 Synced » get assets/pandectes-settings.json
DEBUG [HotReload] Modified assets/pandectes-settings.json
DEBUG update assets/pandectes-settings.json
DEBUG PUT https://fondussimo-dev.myshopify.com/admin/api/unstable/themes/169819767075/assets.json with request_id: e7e4abcc-e7bc-403d-9fa3-419f04802df4-1720014725
  • 09:52:05 Synced » update assets/pandectes-settings.json
^CDEBUG Stop signal: "SIGINT"
Stopping…
[2024-07-03 09:52:06] INFO  going to shutdown ...
[2024-07-03 09:52:06] INFO  WEBrick::HTTPServer#start done.
DEBUG Stop signal: "SIGTERM"
Stopping…

@rcasimmons
Copy link

rcasimmons commented Jul 3, 2024

Still waiting for the update via Brew @karreiro.

@jpallard6120 seems you're not the only one - happening for my collegue on Windows with the CLI updated to the new version:

image

@karreiro
Copy link
Contributor

karreiro commented Jul 4, 2024

Thank you for sharing that scenario, @jpallard6120! I can reproduce that, and it seems to be a different but related issue. We may expect that to be fixed in the next CLI release.

Thank you for sharing this scenario as well, @rcasimmons! Could you please share the full --verbose log? With that, I may understand extra details about your theme and store to fix it (we shouldn't be facing issues with templates/* files, but with extra pointers, I may understand why it's happening in that case).

@rcasimmons
Copy link

Thank you for sharing that scenario, @jpallard6120! I can reproduce that, and it seems to be a different but related issue. We may expect that to be fixed in the next CLI release.

Thank you for sharing this scenario as well, @rcasimmons! Could you please share the full --verbose log? With that, I may understand extra details about your theme and store to fix it (we shouldn't be facing issues with templates/* files, but with extra pointers, I may understand why it's happening in that case).

Thanks @karreiro!

I'll get him to reply with his verbose log on here.

In the meantime, I'm still unable to upgrade my CLI via Homebrew. Has the package been released yet onto here?

@RCA-JC
Copy link

RCA-JC commented Jul 4, 2024

@karreiro I am @rcasimmons colleague that is still experiencing a loop post-update, using WSL. Here are my verbose logs.

DEBUG get templates/page.about.json
DEBUG PUT https://thegoodwineshop.myshopify.com/admin/api/unstable/themes/127381307458/assets.json with request_id: 9676f90b-967c-4fd3-b4c8-46c41ced2eff-1720082327
  • 09:38:48 Synced » update assets/swatches.json
DEBUG get templates/page.shops.json
DEBUG GET https://thegoodwineshop.myshopify.com/admin/api/unstable/themes/127381307458/assets.json?asset%5Bkey%5D=templates%2Fpage.about.json with request_id: 18891622-b4c4-486f-8516-9ae122604bfc-1720082327
  • 09:38:48 Synced » get templates/page.about.json
DEBUG [HotReload] Modified templates/page.about.json
DEBUG update templates/page.about.json
DEBUG GET https://thegoodwineshop.myshopify.com/admin/api/unstable/themes/127381307458/assets.json?asset%5Bkey%5D=templates%2Fpage.shops.json with request_id: 5098c3a4-9b3f-489f-945f-8e25bfec9c0b-1720082328
  • 09:38:49 Synced » get templates/page.shops.json
DEBUG [HotReload] Modified templates/page.shops.json
DEBUG update templates/page.shops.json
DEBUG PUT https://thegoodwineshop.myshopify.com/admin/api/unstable/themes/127381307458/assets.json with request_id: 45b96d62-318b-4d37-b733-b2da00bfca43-1720082328
  • 09:38:49 Synced » update templates/page.about.json
DEBUG PUT https://thegoodwineshop.myshopify.com/admin/api/unstable/themes/127381307458/assets.json with request_id: 7658baa3-9f1f-43e3-a117-832f39411b53-1720082328
  • 09:38:49 Synced » update templates/page.shops.json
DEBUG GET https://thegoodwineshop.myshopify.com/admin/api/unstable/themes/127381307458/assets.json with request_id: d37df67b-f23e-4b04-8fe5-ced5a85cb1c8-1720082330
DEBUG get assets/swatches.json
DEBUG get templates/page.about.json
DEBUG GET https://thegoodwineshop.myshopify.com/admin/api/unstable/themes/127381307458/assets.json?asset%5Bkey%5D=assets%2Fswatches.json with request_id: 1409cf56-8036-4ebd-96ca-982d3abf5702-1720082330
  • 09:38:51 Synced » get assets/swatches.json
DEBUG get templates/page.shops.json
DEBUG GET https://thegoodwineshop.myshopify.com/admin/api/unstable/themes/127381307458/assets.json?asset%5Bkey%5D=templates%2Fpage.about.json with request_id: 218dc737-f25d-4d56-8216-93fe5b106f2f-1720082330
  • 09:38:51 Synced » get templates/page.about.json
DEBUG update assets/swatches.json
DEBUG [HotReload] Modified assets/swatches.json, templates/page.about.json
DEBUG GET https://thegoodwineshop.myshopify.com/admin/api/unstable/themes/127381307458/assets.json?asset%5Bkey%5D=templates%2Fpage.shops.json with request_id: feba16b8-1eea-4f62-a43d-49f6c9f0c48d-1720082330
  • 09:38:51 Synced » get templates/page.shops.json
DEBUG update templates/page.about.json
DEBUG PUT https://thegoodwineshop.myshopify.com/admin/api/unstable/themes/127381307458/assets.json with request_id: 1335d688-312c-410a-a73c-637ae224caf5-1720082330
  • 09:38:51 Synced » update assets/swatches.json
DEBUG [HotReload] Modified templates/page.shops.json
DEBUG update templates/page.shops.json
DEBUG PUT https://thegoodwineshop.myshopify.com/admin/api/unstable/themes/127381307458/assets.json with request_id: 9f6dcf2a-d801-438e-a5f4-890e0ae73091-1720082331
  • 09:38:52 Synced » update templates/page.about.json
DEBUG PUT https://thegoodwineshop.myshopify.com/admin/api/unstable/themes/127381307458/assets.json with request_id: 56d5e5a6-502c-463f-ae0c-4d0dfc982bbc-1720082331
  • 09:38:52 Synced » update templates/page.shops.json

@karreiro
Copy link
Contributor

karreiro commented Jul 4, 2024

👋 Hey @RCA-JC,

Thank you for sharing the logs! For the assets/swatches.json file (and other assets/ issues), we may expect that to be fixed in the next CLI release.

Regarding the templates/page.about.json and templates/page.shops.json files, the issue is associated with the \u2028 character in the JSON file. The fix for that won't live at the CLI level, but at the platform level (so the fix is not attached to a CLI release). I'm logging that issue at the platform, but, for now, you may work around that problem by using an equivalent character.

Thanks again for sharing those logs! :)

@dennislessaeibeleza
Copy link

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.

This solution did solve my problem.

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 #gsd:40767 Fortify local development experience for Liquid themes moderate lowest severity for theme related bug Type: Bug Something isn't working
Projects
None yet