[Bug]: something was wrong ,see the picture
Version
System:
OS: Windows 10 10.0.19044
CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
Memory: 5.97 GB / 15.66 GB
Browsers:
Edge: Spartan (44.19041.1266.0), Chromium (127.0.2651.74)
Internet Explorer: 11.0.19041.1202
Details
Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
Message: The export "clearGlobal" in "./node_modules/@visactor/vtable/es/index.d.ts" has no internal name (existing names: )
Location: crates\rspack_core\src\concatenated_module.rs:1778
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
Reproduce link
no link
Reproduce Steps
run build
Hello @TryChai, 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.
Why importing value from dts file
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.
@JSerFeng
I got the same issue, It can stable reproduce when run in CI while using DefinePlugin to define an object global variable and read in source code.
The CI system:
- Linux version 5.4.143.bsk.7-amd64 (gcc version 8.3.0 (Debian 8.3.0-6))
But it cannot reproduce on Mac.
See like:
The config is:
const config = {
plugin: [
new DefinePlugin({
BUILD_INFO: {
faker_field_a: "",
faker_field_b: "",
}
})
]
}
The file a.ts:
export function a() {
const test_field = BUILD_INFO?.faker_field_a;
return {}
}
The entry file index.ts:
import { a } from './a'; // <- throw error: The export "a" in "./a.ts" has no internal name (existing names: )
a();
I will try to create a minimum reproduce sandbox for you.
I used a third-party plugin and I got this error when packing, I didn't have this problem with vite packaging, but I migrated to rsbuild and had this problem
Try use bail, see if something wrong in make phase
module.exports = { bail: true }
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.
For those who have the same problem.
When using DefinePlugin, better to use string instead of object for the value.
new DefinePlugin({
'process.env': {
foo: 'a',
bar: 'b'
}
})
// use following instead
new DefinePlugin({
'process.env.foo': JSON.stringify('a'),
'process.env.bar': JSON.stringify('b')
})