Virtual module ids with query parameters that end in .astro
throw errors
#11230
Labels
- P3: minor bug
An edge case that only affects very specific usage (priority)
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
The
transform
hook inside the vite pluginastro:build
matches module ids that are not Astro files but contain paths to Astro files inside query parameters, for example:This issue occurs because Astro uses
.endsWith
to check for Astro filesastro/packages/astro/src/vite-plugin-astro/index.ts
Line 205 in 734b98f
One workaround for this is to add an empty query parameter as a suffix:
What's the expected result?
Astro does not attempt to transform virtual module's that have
.astro
paths inside query parametersLink to Minimal Reproducible Example
https://stackblitz.com/edit/github-vdjlmf?file=astro.config.mjs,src%2Fpages%2Findex.astro
Participation
The text was updated successfully, but these errors were encountered: