fix(bundle): preserve raw imports in watch mode#36040
Merged
nathanwhit merged 1 commit intoJul 15, 2026
Merged
Conversation
nathanwhit
marked this pull request as ready for review
July 14, 2026 23:44
bartlomieju
pushed a commit
that referenced
this pull request
Jul 15, 2026
## Summary - avoid reloading raw import assets as ordinary module graph roots in bundle watch mode - add regression coverage for rebuilding after CSS and TypeScript changes ## Root cause Raw imports are represented as external assets in the module graph, and their contents are fetched by the bundle loader. Watch invalidation passed a changed CSS asset to `ModuleGraph::reload()`, which reloaded the URL as an ordinary root without its `type: "css"` import context. That poisoned the graph and caused every subsequent rebuild to reject the CSS import. External asset entries do not contain source that needs to be refreshed. Esbuild calls the bundle loader again for the changed input, which fetches the current contents, so watch mode now excludes those entries from graph reload while retaining normal reload behavior for source modules. Fixes #36036. ## Validation - `cargo build --bin deno` - `cargo test -p integration_tests --test integration -- watcher::bundle_watch` (3 passed) - `./tools/lint.js` - `./tools/format.js --check` - reproduced the reported HTML/`--outdir` workflow and verified CSS and subsequent TypeScript changes both rebuilt successfully
bartlomieju
added a commit
that referenced
this pull request
Jul 20, 2026
Resolves conflicts: - cli/tools/bundle/mod.rs: port reload_specifiers (incl. #36040 raw-import fix) onto the rolldown DenoPluginHandler and wire watch-mode reload of changed specifiers and HTML entrypoints (restores canonical_path) - Cargo.lock: take main's, upgrade rolldown 1.0.0 -> 1.2.0 to fix duplicate oxc_sourcemap resolution Claude-Session: https://claude.ai/code/session_01QXBexiVeaPBqGPgAxcTLNQ
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.
Summary
Root cause
Raw imports are represented as external assets in the module graph, and their contents are fetched by the bundle loader. Watch invalidation passed a changed CSS asset to
ModuleGraph::reload(), which reloaded the URL as an ordinary root without itstype: "css"import context. That poisoned the graph and caused every subsequent rebuild to reject the CSS import.External asset entries do not contain source that needs to be refreshed. Esbuild calls the bundle loader again for the changed input, which fetches the current contents, so watch mode now excludes those entries from graph reload while retaining normal reload behavior for source modules.
Fixes #36036.
Validation
cargo build --bin denocargo test -p integration_tests --test integration -- watcher::bundle_watch(3 passed)./tools/lint.js./tools/format.js --check--outdirworkflow and verified CSS and subsequent TypeScript changes both rebuilt successfully