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 1.2.3 breaks image-minimizer-webpack-plugin loader #9477

Open
moimael opened this issue Feb 26, 2025 · 1 comment
Open

[Bug]: rspack 1.2.3 breaks image-minimizer-webpack-plugin loader #9477

moimael opened this issue Feb 26, 2025 · 1 comment

Comments

@moimael
Copy link

moimael commented Feb 26, 2025

System Info

System:
OS: macOS
CPU: (10) arm64 Apple M2 Pro
Memory: 928.14 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.18.1 -
Yarn: 4.6.0 -
npm: 10.9.2 -
Watchman: 2024.03.11.00 -

Details

Hi!

Since rspack 1.2.3, image-minimizer-webpack-plugin loader is broken resulting in failed builds.

[bundler] thread '<unnamed>' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc_plugin_proxy-5.0.0/src/memory_interop/read_returned_result_from_host.rs:117:10:
[bundler] Returned value should be serializable: wasm plugin bytecheck failed "failed without error information; enable debug assertions and the `alloc` feature in rancor for error information"
[bundler] note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[bundler] thread '<unnamed>' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc_plugin_proxy-5.0.0/src/memory_interop/read_returned_result_from_host.rs:117:10:
[bundler] Returned value should be serializable: wasm plugin bytecheck failed "failed without error information; enable debug assertions and the `alloc` feature in rancor for error information"
[bundler] note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[bundler] thread '<unnamed>' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc_plugin_proxy-5.0.0/src/memory_interop/read_returned_result_from_host.rs:117:10:
[bundler] Returned value should be serializable: wasm plugin bytecheck failed "failed without error information; enable debug assertions and the `alloc` feature in rancor for error information"
[bundler] note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[bundler] /frontend/node_modules/image-minimizer-webpack-plugin/dist/loader.js:196
[bundler]       this._module.matchResource = `${output.filename}${query}`;
[bundler]                                  ^
[bundler]
[bundler] TypeError: Cannot set property matchResource of #<_Module> which has only a getter
[bundler]     at Object.loader (/frontend/node_modules/image-minimizer-webpack-plugin/dist/loader.js:196:34)
[bundler]
[bundler] Node.js v20.15.1
[bundler] NODE_ENV=production NODE_OPTIONS="--max-old-space-size=8192" rspack build --config /frontend/apps/ca-server/rspack.config.ts  exited with code 1
node:internal/process/promises:389
      new UnhandledPromiseRejection(reason);
      ^

UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "[object Array]".
    at throwUnhandledRejectionsMode (node:internal/process/promises:389:7)
    at processPromiseRejections (node:internal/process/promises:470:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:32) {
  code: 'ERR_UNHANDLED_REJECTION'
}

Reproduce link

No response

Reproduce Steps

 test: /\.(jpe?g|png)$/,
    use: [
            {
              loader: ImageMinimizerPlugin.loader,
              options: {
                minimizer: {
                  implementation: ImageMinimizerPlugin.sharpMinify,
                },
              },
            },
          ]
    ],
  },
@moimael moimael added the pending triage The issue/PR is currently untouched. label Feb 26, 2025
@chenjiahan chenjiahan added need reproduction and removed pending triage The issue/PR is currently untouched. labels Feb 26, 2025
Copy link
Contributor

Hello @moimael, sorry we can't investigate the problem further without reproduction demo, please provide a repro demo by forking rspack-repro, or provide a minimal GitHub repository by yourself. Issues labeled by need reproduction will be closed if no activities in 14 days.

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

No branches or pull requests

2 participants