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 theme dev - already compiled asset javascript gets mangled #4525

Closed
2 tasks done
ceri-waterscreative opened this issue Sep 25, 2024 · 2 comments
Closed
2 tasks done
Labels
Area: @shopify/theme @shopify/theme package issues Type: Bug Something isn't working

Comments

@ceri-waterscreative
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

Scripts work as normal

Actual behavior

Despite having .min.js in the filename the script appears to get modified when served via the CLI. I'm guessing in attempt to minimise it?
I've attached the before and after of what's happening so that you can compare.

before.txt
after.txt

Differences..

Code chopped off / removed
Image

Special Characters broken
Image

Verbose output

N/A

Reproduction steps

  1. Add before.txt file as JS to theme
  2. Look at JS loaded in the browser
  3. See differences

Operating System

Windows 11

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

3.67.1

Shell

Git Bash

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

22.7.0

What language and version are you using in your application?

No response

@ceri-waterscreative ceri-waterscreative added the Type: Bug Something isn't working label Sep 25, 2024
@gonzaloriestra gonzaloriestra added the Area: @shopify/theme @shopify/theme package issues label Sep 25, 2024
@ceri-waterscreative
Copy link
Author

Nevermind, fixed in pull #4494

Using

npm i -g @shopify/[email protected]

temporarily

@sillycube
Copy link

The same. The CLI chopped my code. My original code:
_esModule",{value:!0}),e}({},Vue);

When I preview the dev store in http://127.0.0.1:9293, the code in my app extension becomes:
_esModule",{value:!0}),e}({},Vu

As a result, it gives me a syntax error because the ')' is missing. I am using Mac OS with CLI of 3.67.2, node v22.5.1.

I am migrating from a remote CLI login to a local CLI (issue: 4495). And it gives me this issue again. Please give me a way out

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

3 participants