-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Build fails with ?raw imports when mixing SSR and prerendered routes #15316
Copy link
Copy link
Closed
Labels
- P4: importantViolate documented behavior or significantly impacts performance (priority)Violate documented behavior or significantly impacts performance (priority)6-betaIssues affects the beta of Astro 6Issues affects the beta of Astro 6
Description
Astro Info
Astro v6.0.0-beta.3
Vite v7.3.1
Node v24.12.0
System macOS (arm64)
Package Manager npm
Output static
Adapter @astrojs/netlify (v7.0.0-beta.5)
Integrations @astrojs/mdx (v5.0.0-beta.2)
If this issue only occurs in one browser, which browser is a problem?
N/A - build error
Describe the Bug
When an Astro project has both SSR (server-rendered) and prerendered routes that import the same file using the ?raw query parameter, the build fails with:
"default" is not exported by "src/global.css?raw"
The bug only occurs when both SSR and prerendered routes import the same file with ?raw:
- If only prerendered routes use
?raw, it works fine - If only SSR routes use
?raw, it works fine
This affects any file type with ?raw, not just CSS.
What's the expected result?
Build succeeds. The ?raw import should return the file contents as a string (default export) in both route types.
Link to Minimal Reproducible Example
https://github.com/matthewp/astro-6-beta-missing-styles-1
Participation
- I am willing to submit a pull request for this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
- P4: importantViolate documented behavior or significantly impacts performance (priority)Violate documented behavior or significantly impacts performance (priority)6-betaIssues affects the beta of Astro 6Issues affects the beta of Astro 6