cli: [Bug]: JS assets no longer work on `theme dev` on 127.0.0.1 since 3.67.0
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
With the previous version of CLI or with the --legacy flag, JS assets work.
Actual behavior
JS assets no longer work on 127.0.0.1 since upgrading to Shopify CLI 3.67.0.
They’re loaded, but I get a JS error in the console:
Uncaught SyntaxError: missing ) after argument list (at vendors@theme.min.js?v=25063884737306468341726750322:1:131260)
When I go to the theme’s remote url (xxx.myshopify.com/?preview_theme_id=XXXX), it works fine.
When I try with theme dev --legacy, everything works fine.
Here is the end of the JS file vendors@theme.min.js file opened from https://xxx.myshopify.com/cdn/shop/t/17/assets/vendors@theme.min.js?v=25063884737306468341726753546 (remote url):
And now here’s the end of the JS vendors@theme.min.js file opened from http://127.0.0.1:9292/cdn/shop/t/17/assets/vendors@theme.min.js?v=25063884737306468341726752918 (CLI server url):
I notice that ); is missing at the very end of the file.
Would CLI “cut” the file?
Thanks for your help!
Verbose output
Reproduction steps
- Run
shopify theme dev - Go to 127.0.0.1
Operating System
macOS 14.5
Shopify CLI version (check your project’s package.json if you’re not sure)
3.67.0
Shell
No response
Node version (run node -v if you’re not sure)
v20.12.2
What language and version are you using in your application?
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (6 by maintainers)
Thanks for the help, after checking the files you uploaded I realized they had non-printable characters… it should be fixed in https://github.com/Shopify/cli/pull/4494