Closed ilteoood closed 7 months ago
it seems that you must configure
resolve: {
extensions: ['.ts', '.tsx', '.js', '.d.ts']
}
to solve this. Maybe a better error message would be enough
Also, you could enable
experiments: {
rspackFuture: {
newTreeshaking: true
}
}
the diagnostics should be more helpful:
ERROR in × Resolve error: Can't resolve './src/index' in '/home/xxx/Documents/rspack/issues/rspack-build-error-repro'
ERROR in container entry
× Resolve error: Can't resolve './src/routes/organizations/organizationId/company/Company' in '/home/xxxx/Documents/rspack/issues/rspack-build-error-repro'
╭────
╰────
2 ERRORS in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details)
Since the old tree shaking is not compatible with the webpack
arch, and it would be deprecated in the future, we don't have plan to improve this.
System Info
System: OS: macOS 14.3 CPU: (10) arm64 Apple M1 Max Memory: 22.62 GB / 64.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node npm: 10.2.5 - ~/.nvm/versions/node/v20.10.0/bin/npm pnpm: 8.12.1 - ~/.nvm/versions/node/v20.10.0/bin/pnpm Browsers: Chrome: 121.0.6167.139 Edge: 121.0.2277.98 Safari: 17.3
Details
Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues Message: Failed to get normal module of container entry (default) [["./company-page",{"name":null,"import":["./src/routes/organizations/organizationId/company/Company"]}]] Location: crates/rspack_core/src/tree_shaking/optimizer.rs:661
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
2: _napi_register_module_v1
at
3: _napi_register_module_v1
at
4: _napi_register_module_v1
at
5: _napi_register_module_v1
at
6: _napi_register_module_v1
at
7: _napi_register_module_v1
at
8: _napi_register_module_v1
at
9: _napi_register_module_v1
at
10: _napi_register_module_v1
at
11: _napi_register_module_v1
at
12: _napi_register_module_v1
at
13: _napi_register_module_v1
at
14: _napi_register_module_v1
at
15: _napi_register_module_v1
at
16: _napi_register_module_v1
at
17: _napi_register_module_v1
at
18: _napi_register_module_v1
at
19: _napi_register_module_v1
at
20: __pthread_joiner_wake
at
This is the rspack config:
Reproduce link
https://github.com/ilteoood/rspack-build-error-repro
Reproduce Steps
Run
rspack --mode production