Fix SSR full reload failing to re-import astro:server-app with third-party Vite plugins - #17685
Merged
Conversation
…ization (#17684) Vite's ModuleGraph._resolveUrl() appends the resolved file extension to module URLs that don't start with `virtual:` or contain `\0`. This caused `astro:server-app` to become `astro:server-app.js` in the module graph, which then failed to resolve during SSR full reloads triggered by plugins like @tailwindcss/vite. Rename the virtual module ID from `astro:server-app` to `virtual:astro:server-app` to match the convention already used by `virtual:astro:app`.
1 task
Merging this PR will improve performance by 20.14%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | Build: hybrid site (static + server) |
1.6 s | 1.4 s | +20.14% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing triagebot/fix-17684 (d8dd7c3) with main (2066f39)
🦋 Changeset detectedLatest commit: d8dd7c3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 418 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
matthewp
approved these changes
Aug 14, 2026
Open
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.
Closes #17684
Changes
ASTRO_DEV_SERVER_APP_IDwithvirtual:(changing it fromastro:server-apptovirtual:astro:server-app), matching the convention already used by the siblingvirtual:astro:appmodule in the same file. Vite'sModuleGraph._resolveUrl()skips URL normalization for IDs that start withvirtual:— without this prefix, Vite appended.jsto the stored URL, so full-reload attempts viarunner.import("astro:server-app.js")failed to match Astro'sresolveIdfilter.Failed to load url astro:server-app.jsthat appeared when a third-party Vite plugin (e.g.@tailwindcss/vite) triggered an SSR full reload on a non-page file.Testing
@tailwindcss/vitetriggering an SSR full reload, which is outside the current unit/integration test infrastructure.src/content/test.mdnow produces[vite] program reloadwithout theastro:server-app.jserror, and the server continues serving successfully. Confirmed by the issue reporter (@mavam).Docs
No docs update needed — this is an internal virtual module ID fix with no user-facing API change.