Skip to content

[Bug]: Set external extension, compilation error during dependent export #8206

@lzxb

Description

@lzxb

System Info

System:
OS: macOS 15.0.1
CPU: (8) arm64 Apple M1
Memory: 106.00 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.13.1 - ~/.nvm/versions/node/v20.13.1/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v20.13.1/bin/yarn
npm: 10.5.2 - ~/.nvm/versions/node/v20.13.1/bin/npm
pnpm: 8.15.8 - ~/.nvm/versions/node/v20.13.1/bin/pnpm
bun: 1.1.27 - ~/.bun/bin/bun
Browsers:
Safari: 18.0.1
npmPackages:
@rspack/cli: 1.0.14 => 1.0.14
@rspack/core: 1.0.14 => 1.0.14

Details

Named export is normal, but all exports are incorrect

// Compilation failed
export * from 'test2';
// Compilation successful
export { test2 } from 'test2'

export function test1 () {}

Image

Reproduce link

https://github.com/lzxb/rspack-externals-error

Reproduce Steps

  1. rspack.config.js
{
    externals: ['test2']
}
  1. packages/test1/index.js
export * from 'test2';
  1. Run command
pnpm build

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions