[Bug]: .js
in package name fails the build (e.g. highlight.js
)
#6785
Labels
bug
Something isn't working
.js
in package name fails the build (e.g. highlight.js
)
#6785
System Info
System:
OS: macOS 14.5
CPU: (10) arm64 Apple M1 Max
Memory: 2.63 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.14.0 - ~/.nvm/versions/node/v20.14.0/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v20.14.0/bin/yarn
npm: 10.7.0 - ~/.nvm/versions/node/v20.14.0/bin/npm
pnpm: 7.28.0 - ~/Library/pnpm/pnpm
bun: 1.1.8 - ~/.bun/bin/bun
Browsers:
Chrome: 125.0.6422.142
Edge: 125.0.2535.92
Safari: 17.5
npmPackages:
@rspack/cli: ^0.7.0 => 0.7.2
@rspack/core: ^0.7.0 => 0.7.2
Details
I was trying to use react-syntax-highlighter or react-highlight, but the build was failing. After digging into it, it seems it's because both of them use highlight.js underneath.
Seems that because the package name has the extension
.js
in it, RSPack doesn't handle it properly and crashes with:Reproduce link
https://github.com/markmssd/rspack-repro/tree/highlight.js
Reproduce Steps
This will fail with the above error, due to this import: https://github.com/markmssd/rspack-repro/blob/highlight.js/src/render.js#L1. If you simply comment this line, it will work fine.
The text was updated successfully, but these errors were encountered: