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

React does not work in --mode=production #5258

Closed
cut0 opened this issue Jan 8, 2024 · 1 comment · Fixed by #5260
Closed

React does not work in --mode=production #5258

cut0 opened this issue Jan 8, 2024 · 1 comment · Fixed by #5260
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.

Comments

@cut0
Copy link

cut0 commented Jan 8, 2024

System Info

  System:
    OS: macOS 14.1.1
    CPU: (8) arm64 Apple M1 Max
    Memory: 64 GB
  Binaries:
    Node: v18.16.0
    pnpm: v8.2.0
  Browsers:
    Chrome: v120.0.6099.199
  npmPackages:
    @rspack/binding: workspace:* => 0.4.5 
    @rspack/core: workspace:* => 0.4.5 

Details

After executing

pnpm create rsbuild@latest

according to "Using the Rspack CLI", when specifying production in the mode of rspack.config.js, or when specifying

rspack -----mode=production serve

in the npm script and opening the web page, the following display appears.

スクリーンショット 2024-01-08 午前10 17 57

When 'development' is specified for mode, it displays normally as shown below.

スクリーンショット 2024-01-08 午前10 17 37

Reproduce link

https://github.com/cut0/rspack-project

Reproduce Steps

Please follow the steps below.

  1. pnpm i
  2. pnpm dev
  3. Please open Chrome (the issue may also be reproducible in other browsers).
@cut0 cut0 added bug Something isn't working pending triage The issue/PR is currently untouched. labels Jan 8, 2024
@hardfist
Copy link
Contributor

hardfist commented Jan 8, 2024

https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/793d57c95ee64a1b9612a96066f091db08b226cb/lib/index.js#L48 react-refresh-webpack-plugin will skip inject refresh runtime when mode set to production which @rspack/plugin-react-refresh not align with now, cc @ahabhgk
you can manually disable @rspack/plugin-react-refresh when mode set to production now, we will fix it soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.
Projects
None yet
2 participants