Skip to content

[Bug]: "not exported" error happens because export statements after throw are ignored  #3402

@sapphi-red

Description

@sapphi-red

Reproduction link or steps

  1. Open https://stackblitz.com/edit/github-nci4o6nk-ynvw9kzq?file=src%2Fa.mjs,src%2Findex.mjs
  2. npm i runs automatically
  3. npm run build runs automatically
  4. Build errors with "foo" is not exported by "src/a.mjs".
  5. Run node src/index.mjs to check that it's a runtime error rather than a early error

What is expected?

No error happens when building. Error happens at runtime.

What is actually happening?

Error ("foo" is not exported by "src/a.mjs") happens when building.

System Info

Stackblitz

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    rolldown: 1.0.0-beta.2-commit.2666b23 => 1.0.0-beta.2-commit.f069c5d

Any additional comments?

I found this while testing rolldown-vite on ecosystem-ci.

Metadata

Metadata

Assignees

Labels

Type

No type

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions