Display full error messages when the build fails in electrobun build or electrobun dev.#367
Open
chrisvariety wants to merge 1 commit intoblackboardsh:mainfrom
Open
Display full error messages when the build fails in electrobun build or electrobun dev.#367chrisvariety wants to merge 1 commit intoblackboardsh:mainfrom
electrobun build or electrobun dev.#367chrisvariety wants to merge 1 commit intoblackboardsh:mainfrom
Conversation
…` or `electrobun dev`. `runBuild` can throw other types of errors, e.g. [AggregateError](https://github.com/oven-sh/bun/blob/1afabdde2eb7fe609933b770364611854f8e8dda/src/bundler/bundle_v2.zig#L2275). Currently those errors are just swallowed, leading to the output of a failed build being: ``` $ electrobun dev Using config file: electrobun.config.ts Bundle failed ``` This fix displays the full error by aligning the `dev` and `build` commands with `dev --watch` which [already logs errors in a similar manner](https://github.com/blackboardsh/electrobun/blob/fc3e62da6335845f02d9ed7e5d3d9480c741f08a/package/src/cli/index.ts#L4370): ``` $ electrobun dev Build failed: 1 | import foo from 'bar';foo(); ^ error: Could not resolve: "bar". Maybe you need to "bun install"? at /Users/chrismcc/workspace/src/my-hello-world-app/src/bun/index.ts:1:17 ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
runBuildcan throw other types of errors, e.g. AggregateError.Currently those errors are just swallowed, leading to the output of a failed build being:
This fix displays the full error by aligning the
devandbuildcommands withdev --watchwhich already logs errors in a similar manner: