Skip to content

[Bug]: Rolldown does not show the stacktrace when an error happened inside JS plugins #2551

@sapphi-red

Description

@sapphi-red

Reproduction link or steps

  1. Open https://stackblitz.com/edit/github-xv4yss?file=package.json,rolldown.config.mjs
  2. npm i and npm run build runs automatically
  3. The error is shown

What is expected?

The following error happens:

[!] (plugin foo) Error: throw!
src/entry.js
    at Object.transform (file:///home/projects/xoriwgqxmv.github/rolldown.config.mjs:24:15)
    at eval (/home/.npm/_npx/1ee1cf83ded2a161/node_modules/rollup/dist/shared/rollup.js:1087:40)
    at <anonymous> (https://xoriwgqxmvgithub-1r5y.w-credentialless-staticblitz.com/blitz.34c588ed.js:40:22847)

It does not have to be the same. The important points are

  • show which plugin failed
  • show the stacktrace
  • show the processing file when that error happened

What is actually happening?

The following error happens:

[UNHANDLEABLE_ERROR] Error: Something wrong inside the rolldown, please report this at https://github.com/rolldown/rolldown/issues.
GenericFailure, Error: throw!

[UNHANDLEABLE_ERROR] Error: Something wrong inside the rolldown, please report this at https://github.com/rolldown/rolldown/issues.
GenericFailure, Error: throw!

Error: Build failed
    at napi_create_error (/home/projects/xoriwgqxmv.github/node_modules/@emnapi/core/dist/emnapi-core.cjs.js:4535:25)
    at eval (/home/projects/xoriwgqxmv.github/node_modules/@emnapi/core/dist/emnapi-core.cjs.js:1283:58)
    at NodeEnv.callIntoModule (/home/projects/xoriwgqxmv.github/node_modules/@emnapi/runtime/dist/emnapi.cjs.js:639:19)
    at NodeEnv.callbackIntoModule (/home/projects/xoriwgqxmv.github/node_modules/@emnapi/runtime/dist/emnapi.cjs.js:758:21)
    at f (/home/projects/xoriwgqxmv.github/node_modules/@emnapi/core/dist/emnapi-core.cjs.js:1277:37)
    at Object.dispatchOne (/home/projects/xoriwgqxmv.github/node_modules/@emnapi/core/dist/emnapi-core.cjs.js:1305:29)
    at Object.dispatch (/home/projects/xoriwgqxmv.github/node_modules/@emnapi/core/dist/emnapi-core.cjs.js:1321:43)
    at Worker.handler (/home/projects/xoriwgqxmv.github/node_modules/@emnapi/core/dist/emnapi-core.cjs.js:864:40) {
  code: 'GenericFailure'
}

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: https://pkg.pr.new/rolldown@6aa4503 => 0.13.2

Any additional comments?

No response

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