fix(astro): suppress spurious astro:server-app.js warning with @tailwindcss/vite#16191
Open
rururux wants to merge 4 commits into
Open
fix(astro): suppress spurious astro:server-app.js warning with @tailwindcss/vite#16191rururux wants to merge 4 commits into
astro:server-app.js warning with @tailwindcss/vite#16191rururux wants to merge 4 commits into
Conversation
🦋 Changeset detectedLatest commit: 78d58d8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 436 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 |
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: #15986
(The error mentioned in the issue title has been confirmed fixed in Astro@6.1.3, but since this warning log was also reported in the same issue, I'm including this fix here as well.)
Changes
When using the
@tailwindcss/viteplugin, aFailed to load url astro:server-app.js (resolved id: astro:server-app.js). Does the file exist?warning could appear under certain conditions.Steps to reproduce
(see also: https://stackblitz.com/edit/github-zxlwk9jg?file=src%2Fpages%2Ftest.astro,src%2Fstyles%2Fglobal.css,src%2Fpages%2Findex.astro)
The root cause is that the virtual module ID
astro:server-appdoes not start withvirtual:, causing Vite to mistake it for a regular JS file. The fix prefixes the ID withvirtual:to ensure Vite handles it correctly.Testing
Added an e2e test that monitors console output to verify the warning no longer appears.
Docs
N/A, bug fix