Shopify / cli

Build apps, themes, and hydrogen storefronts for Shopify
https://shopify.dev
MIT License
436 stars 128 forks source link

[Bug]: Unexpected end of input error for JS files that contain curly apostrophes #4535

Closed nikitaourazbaev closed 1 month ago

nikitaourazbaev commented 1 month ago

Please confirm that you have:

In which of these areas are you experiencing a problem?

Theme

Expected behavior

The file synced should be the same as the local file

Actual behavior

The file does not get synced correctly, resulting in an “Uncaught SyntaxError: Unexpected end of input”

This seems to be related to https://github.com/Shopify/cli/issues/4525 and gets fixed with npm i -g @shopify/cli@0.0.0-snapshot-20240920142835

Verbose output

2024-09-26T14:27:54.368Z: ← 200 (request_id: 2c1d0c57-3b07-462f-b6a7-f5bbb02e5f15-1727360873) 2024-09-26T14:27:54.832Z: Request to https://theme-kit-access.shopifyapps.com/cli/admin/api/unstable/themes/128731349105/assets/bulk.json completed in 952 ms With response headers:

• 10:27:54 Synced » update assets/utils.js

Reproduction steps

  1. This file works: https://gist.github.com/nikitaourazbaev/99ea8d0c071662f82d3e1c5c0b585346#file-will-work-js
  2. This file won’t work – only difference is the apostrophe after the word Shopify: https://gist.github.com/nikitaourazbaev/99ea8d0c071662f82d3e1c5c0b585346#file-wont-work-js

Operating System

macOS Ventura 14.7

Shopify CLI version (check your project's package.json if you're not sure)

3.67.2

Shell

Warp, fish

Node version (run node -v if you're not sure)

v20.11.1

What language and version are you using in your application?

Liquid

montalvomiguelo commented 1 month ago

a fix for this is included in 3.68.0 🚀

frandiox commented 1 month ago

@nikitaourazbaev Thanks for the reproduction files! As mentioned above, this is fixed in 3.68.0 (I've tested your files with and without the fix).

Btw @montalvomiguelo thanks for notifying everyone about the release 🙌