-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Open
Labels
bugSomething isn't workingSomething isn't workingconfirmed bugWe can reproduce this issueWe can reproduce this issueconsoleRelated to console apisRelated to console apisgood first issueSomething that would be good for new contributorsSomething that would be good for new contributors
Description
What version of Bun is running?
1.2.20-debug+97a530d83
What platform is your computer?
Darwin 24.5.0 arm64 arm
What steps can reproduce the bug?
function foo() {
return new Error("foo!");
}
function bar() {
return new Error("bar!");
}
throw new AggregateError([foo(), bar()], "qux!");What is the expected behavior?
❯ node index.ts
file:///private/var/folders/1f/g5b35_615ds81xl6w9twzksc0000gn/T/tmp.kmAySuNHiY/index.ts:9
throw new AggregateError([foo(), bar()], "qux!");
^
AggregateError: qux!
at file:///private/var/folders/1f/g5b35_615ds81xl6w9twzksc0000gn/T/tmp.kmAySuNHiY/index.ts:9:7
at ModuleJob.run (node:internal/modules/esm/module_job:365:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:99:5) {
[errors]: [
Error: foo!
at foo (file:///private/var/folders/1f/g5b35_615ds81xl6w9twzksc0000gn/T/tmp.kmAySuNHiY/index.ts:2:10)
at file:///private/var/folders/1f/g5b35_615ds81xl6w9twzksc0000gn/T/tmp.kmAySuNHiY/index.ts:9:27
at ModuleJob.run (node:internal/modules/esm/module_job:365:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:99:5),
Error: bar!
at bar (file:///private/var/folders/1f/g5b35_615ds81xl6w9twzksc0000gn/T/tmp.kmAySuNHiY/index.ts:6:10)
at file:///private/var/folders/1f/g5b35_615ds81xl6w9twzksc0000gn/T/tmp.kmAySuNHiY/index.ts:9:34
at ModuleJob.run (node:internal/modules/esm/module_job:365:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:99:5)
]
}
Node.js v24.3.0
What do you see instead?
❯ bun-debug index.ts
1 | function foo() {
2 | return new Error("foo!");
^
error: foo!
at foo (/private/var/folders/1f/g5b35_615ds81xl6w9twzksc0000gn/T/tmp.kmAySuNHiY/index.ts:2:10)
at /private/var/folders/1f/g5b35_615ds81xl6w9twzksc0000gn/T/tmp.kmAySuNHiY/index.ts:9:27
at loadAndEvaluateModule (7:44)
at asyncFunctionResume (9:85)
at promiseReactionJobWithoutPromiseUnwrapAsyncContext (14:20)
at promiseReactionJob (31:60)
1 | function foo() {
2 | return new Error("foo!");
3 | }
4 |
5 | function bar() {
6 | return new Error("bar!");
^
error: bar!
at bar (/private/var/folders/1f/g5b35_615ds81xl6w9twzksc0000gn/T/tmp.kmAySuNHiY/index.ts:6:10)
at /private/var/folders/1f/g5b35_615ds81xl6w9twzksc0000gn/T/tmp.kmAySuNHiY/index.ts:9:34
at loadAndEvaluateModule (7:44)
at asyncFunctionResume (9:85)
at promiseReactionJobWithoutPromiseUnwrapAsyncContext (14:20)
at promiseReactionJob (31:60)
Bun v1.2.20-debug+97a530d83 (macOS arm64)
Additional information
it should be more clear the errors are part of an AggregateError
the AggregateError's own message should be printed
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingconfirmed bugWe can reproduce this issueWe can reproduce this issueconsoleRelated to console apisRelated to console apisgood first issueSomething that would be good for new contributorsSomething that would be good for new contributors