Skip to content

fix(bundledDev): print build errors to the terminal when an HMR update fails#23024

Merged
sapphi-red merged 1 commit into
mainfrom
07-23-fix_bundleddev_print_build_errors_to_the_terminal_when_an_hmr_update_fails
Jul 24, 2026
Merged

fix(bundledDev): print build errors to the terminal when an HMR update fails#23024
sapphi-red merged 1 commit into
mainfrom
07-23-fix_bundleddev_print_build_errors_to_the_terminal_when_an_hmr_update_fails

Conversation

@shulaoda

Copy link
Copy Markdown
Member

Description

In bundled dev mode (experimental.bundledDev), when a file change breaks the build (for example an import path that cannot be resolved), the error is only shown in the browser overlay. The terminal prints nothing.

Expected behavior is the same as normal dev mode: every failed build prints the error in the terminal, and after the file is fixed the terminal shows the recovery (hmr update / page reload).

The cause is that the two dev engine callbacks handle errors differently:

  • The onOutput error branch logs ✘ Build error to the terminal and sends the overlay.
  • The onHmrUpdates error branch only sends the overlay.

With the default rebuild strategy, a file change only generates HMR updates, so a failed rebuild goes through onHmrUpdates and the terminal stays silent.

This PR adds the same ✘ Build error logging to the onHmrUpdates error branch.

Before:

(nothing is printed on a failed HMR rebuild)

After:

✘ Build error: Build failed with 1 error:

[UNRESOLVED_IMPORT] Could not resolve './src/components/HelloWorld.vue' in src/App.vue
   ╭─[ src/App.vue:2:24 ]
   │
 2 │ import HelloWorld from "./src/components/HelloWorld.vue";
   │                        ────────────────┬────────────────
   │                                        ╰────────────────── Module not found.
───╯

Also added a serverLogs assertion to the existing handle generate hmr patch error playground test. The assertion fails without this fix and passes with it.

closes rolldown/rolldown#10136

@shulaoda
shulaoda requested review from btea and sapphi-red July 23, 2026 09:47

@btea btea left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to maintain consistent behavior across different modes.

@sapphi-red sapphi-red added p2-edge-case Bug, but has workaround or limited in scope (priority) feat: bundled-dev labels Jul 24, 2026
@sapphi-red
sapphi-red merged commit 41c4658 into main Jul 24, 2026
22 of 23 checks passed
@sapphi-red
sapphi-red deleted the 07-23-fix_bundleddev_print_build_errors_to_the_terminal_when_an_hmr_update_fails branch July 24, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: bundled-dev p2-edge-case Bug, but has workaround or limited in scope (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Panic]: thread 'rolldown-worker' (11046093) panicked at crates/rolldown_common/src/types/hybrid_index_vec.rs:76:28

3 participants