Skip to content

Commit 0472f00

Browse files
authored
Enhance error message for bundling failures (#57)
Bundling errors are now displayed in the CLI output, providing immediate feedback when build issues occur.
1 parent 989d211 commit 0472f00

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
__default__: prerelease
3+
---
4+
5+
Bundling errors are now displayed in the CLI output, providing immediate feedback when build issues occur.

packages/runtime/src/bundler/errors.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export class BundlingFailedError extends Error {
2020
public readonly modulePath: string,
2121
public readonly reason: string
2222
) {
23-
super(`Bundling of ${modulePath} failed`);
23+
const reasonMessage = JSON.parse(reason).message ?? reason;
24+
super(`Bundling of ${modulePath} failed with error:\n\n${reasonMessage}\n`);
2425
this.name = 'BundlingFailedError';
2526
}
2627
}

0 commit comments

Comments
 (0)