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]: using concatenateModules with rspack serve cause runtime panic "should have build info" #5594

Closed
colinaaa opened this issue Feb 3, 2024 · 5 comments · Fixed by #5692 or #5930
Assignees
Labels
bug Something isn't working

Comments

@colinaaa
Copy link
Contributor

colinaaa commented Feb 3, 2024

System Info

  Binaries:
    Node: 18.17.1 - ~/Library/Caches/fnm_multishells/180_1706947163882/bin/node
    Yarn: 1.22.19 - ~/Library/Caches/fnm_multishells/180_1706947163882/bin/yarn
    npm: 9.6.7 - ~/Library/Caches/fnm_multishells/180_1706947163882/bin/npm
    pnpm: 7.33.6 - ~/Library/Caches/fnm_multishells/180_1706947163882/bin/pnpm
  Browsers:
    Chrome: 121.0.6167.139
    Firefox Nightly: 115.0
    Safari: 17.0
  npmPackages:
    @rspack/cli: 0.5.3-canary-c9f8d78-20240201071306 => 0.5.3-canary-c9f8d78-20240201071306
    @rspack/core: 0.5.3-canary-c9f8d78-20240201071306 => 0.5.3-canary-c9f8d78-20240201071306

Details

I'm using the concatenateModules from #5415. It is great that the bundle size reduced significantly!

But when using rspack serve, the following panic happens.

if !m.build_info().expect("should have build info").strict {

Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
Message:  should have build info
Location: crates/rspack_plugin_javascript/src/plugin/module_concatenation_plugin.rs:575

Reproduce link

No response

Reproduce Steps

With the following files:

// src/index.js
console.log('Hello, rspack');
// rspack.config.js
export default {
  entry: {
    main: "./src/index.js",
  },
  optimization: {
    concatenateModules: true,
    minimize: false,
  },
  experiments: {
    rspackFuture: {
      newTreeshaking: true,
    },
  },
};

run rspack serve and edit the src/index.js will re-produce the panic.

@colinaaa colinaaa added bug Something isn't working pending triage The issue/PR is currently untouched. labels Feb 3, 2024
@IWANABETHATGUY
Copy link
Contributor

It's a known issue, @jerrykingxyz

@sachin-walunj
Copy link

I am also facing error

Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
Message:  internal error: entered unreachable code
Location: crates/rspack_plugin_javascript/src/dependency/esm/provide_dependency.rs:82

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 1: _napi_register_module_v1
    at <unknown source file>
 2: _napi_register_module_v1
    at <unknown source file>
 3: _napi_register_module_v1
    at <unknown source file>
 4: _napi_register_module_v1
    at <unknown source file>
 5: _napi_register_module_v1
    at <unknown source file>
 6: _napi_register_module_v1
    at <unknown source file>
 7: _napi_register_module_v1
    at <unknown source file>
 8: _napi_register_module_v1
    at <unknown source file>
 9: _napi_register_module_v1
    at <unknown source file>
10: _napi_register_module_v1
    at <unknown source file>
11: _napi_register_module_v1
    at <unknown source file>

@jerrykingxyz jerrykingxyz removed the pending triage The issue/PR is currently untouched. label Feb 19, 2024
@IWANABETHATGUY
Copy link
Contributor

I am also facing error

Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
Message:  internal error: entered unreachable code
Location: crates/rspack_plugin_javascript/src/dependency/esm/provide_dependency.rs:82

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
Run with RUST_BACKTRACE=full to include source snippets.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 1: _napi_register_module_v1
    at <unknown source file>
 2: _napi_register_module_v1
    at <unknown source file>
 3: _napi_register_module_v1
    at <unknown source file>
 4: _napi_register_module_v1
    at <unknown source file>
 5: _napi_register_module_v1
    at <unknown source file>
 6: _napi_register_module_v1
    at <unknown source file>
 7: _napi_register_module_v1
    at <unknown source file>
 8: _napi_register_module_v1
    at <unknown source file>
 9: _napi_register_module_v1
    at <unknown source file>
10: _napi_register_module_v1
    at <unknown source file>
11: _napi_register_module_v1
    at <unknown source file>

It looks like your issue is irrelated, could you please file another issue?

@jerrykingxyz jerrykingxyz linked a pull request Feb 20, 2024 that will close this issue
2 tasks
@colinaaa
Copy link
Contributor Author

I tried the canary version in #5692 with the same demo, and another panic occurred:

Module(<path>) should be added before using.

Message:  Module(/home/webpack-app/node_modules/.pnpm/@[email protected]_cfxbo3brkdttvrslyfa2opfk5e/node_modules/@rspack/dev-server/client/index.js?protocol=ws%3A&hostname=0.0.0.0&port=8080&pathname=%2Fws&logging=info&overlay=%7B%22errors%22%3Atrue%2C%22warnings%22%3Afalse%7D&reconnect=10&hot=true&live-reload=true|94e243c27d9fb0a2fa50cb7b8d90fd3f) should be added before using
Location: crates/rspack_core/src/chunk_graph/chunk_graph_module.rs:75

Should I file another issue? Or re-open this one?

BTW, I can make a workaround by setting devServer.client to false.

@IWANABETHATGUY
Copy link
Contributor

IWANABETHATGUY commented Mar 13, 2024

can you try 0.5.7-canary-6007430-20240313111541 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants