web-infra-dev / rspack

The fast Rust-based web bundler with webpack-compatible API 🦀️
https://rspack.dev
MIT License
9.71k stars 559 forks source link

[Bug]: The production environment page crashes and reports TypeError when the version is upgraded to 1.0.0-alpha.5 #7293

Closed Zzzdy-code closed 1 month ago

Zzzdy-code commented 3 months ago

System Info

System: OS: Ubuntu 20.04.6 LTS Memory: 31.00 GB Binaries: Node: 18.20.3 npm: 10.7.0 Browsers: Chrome: 112.0.5615.121 npmPackages: "@rspack/cli": "^1.0.0-alpha.5", "@rspack/core": "^1.0.0-alpha.5", "@rspack/dev-server": "^1.0.0-alpha.5", "@rspack/plugin-react-refresh": "^1.0.0-alpha.5",

Details

When I upgraded rspack to 1.0.0-alpha.5, my code worked fine in the development environment, but when I deployed to the production environment, the page crashed with a white screen. This error can be simulated and reproduced in the local development environment by opening the build product page. This is a local simulation reproduction. image This is the production environment. image image It only appear in the production environment.When I changed the mode to another environment, the product was fine.

const base = require('./rspack.base');

module.exports = {
  ...base,
  mode: 'production', // change to another environment, the product was fine
  entry: {
    'cache-polyfill': 'cache-polyfill.js',
    index: 'entry.tsx',
  },
  output: {
    ...base.output,
    filename: '[name].[contenthash].js',
  },
  optimization: {
    minimize: true,
  },
};

Reproduce link

No response

Reproduce Steps

  1. Run npm run build
  2. open the index.html in /dist This problem occurs in rspack1.0.0-alpha.0 and later versions.
github-actions[bot] commented 2 months ago

Hello @Zzzdy-code, 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.

github-actions[bot] commented 1 month ago

Since the issue was labeled with need reproduction, but no response in 14 days. This issue will be closed. Feel free to comment and reopen it if you have any further questions.