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]: rspack.HtmlRspackPlugin has some magical question #9175

Open
cloudnine-rain opened this issue Feb 6, 2025 · 2 comments
Open

[Bug]: rspack.HtmlRspackPlugin has some magical question #9175

cloudnine-rain opened this issue Feb 6, 2025 · 2 comments
Assignees

Comments

@cloudnine-rain
Copy link

System Info

System:
OS: macOS 15.2
CPU: (10) arm64 Apple M4
Memory: 104.98 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 21.4.0 - ~/.local/state/fnm_multishells/76904_1738824919490/bin/node
npm: 10.2.4 - ~/.local/state/fnm_multishells/76904_1738824919490/bin/npm
pnpm: 9.15.4 - ~/.local/state/fnm_multishells/76904_1738824919490/bin/pnpm
Browsers:
Chrome: 132.0.6834.160
Safari: 18.2
npmPackages:
@rspack/cli: ^1.2.2 => 1.2.2
@rspack/core: ^1.2.2 => 1.2.2

Details

npm run build

Image

I tried to fix it in a few ways It worked, but it's hard to figure out.

Method 1
rspack.HtmlRspackPlugin options minify: true change into false

Image

Method 2
Comment out a portion of the code in the scripts tag in the html file.

Image

Reproduce link

https://github.com/cloudnine-rain/rspack-HtmlRspackPlugin-demo

Reproduce Steps

  1. npm install
  2. npm run build
@LingyuCoder
Copy link
Contributor

Seems to be caused by swc minifier. After upgrading swc to v13, there was no error anymore.

You can try this canary version: 1.2.3-canary-4478c786-20250208035651. You can install it and follow this guide to enable it. If you encounter any other problems, please let us know.

@cloudnine-rain
Copy link
Author

Seems to be caused by swc minifier. After upgrading swc to v13, there was no error anymore.

You can try this canary version: 1.2.3-canary-4478c786-20250208035651. You can install it and follow this guide to enable it. If you encounter any other problems, please let us know.

Thank you very much, this new version solves the problem in my demo and company projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants