-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Styles aren't always included in dev mode #16181
Copy link
Copy link
Open
Labels
needs responseIssue needs response from OPIssue needs response from OPneeds triageIssue needs to be triagedIssue needs to be triaged
Description
Astro Info
Astro v6.1.2
Vite v7.3.1
Node v24.6.0
System Linux (x64)
Package Manager pnpm
Output static
Adapter @astrojs/node (v10.0.4)
Integrations @astrojs/mdx (v5.0.3)
build/info
build/images
build/cleanup
@astrojs/sitemap (v3.7.2)
gab-astro-compress (v0.1.2)
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
After upgrading an Astro v5 project to Astro v6, it happens that the .astro component styles aren't included in the dev mode output.
Use case:
- I have
.astrocomponents, that contains some markup,scriptandstyletag:
<h1>My Component</h1>
<script> // component script </script>
<style type="scss" is:global> /* component styles */</style>- The components are included in multiple pages (as part of mdx content), for example:
---
frontmatter...
---
import Photo from "@components/content/photo.astro";
Some paragraph...
<Photo ... />
Some paragraph...- When browsing the website in
devmode, thestyleof some components is most of the time missing, but not always; ie on certain pages the component has its styles included, on others it does not and the presentation is broken. - After running
build, the styles are again present as they should, even in places, where they were missing indevmode.
I was not able to reproduce this on a brand new Astro v6 install yet.
This issue appeared alongside #16179 issue (after upgrade to Astro v6).
What's the expected result?
All styles should be present in dev mode view the same way as later in the built version (or like in Astro v5).
Link to Minimal Reproducible Example
Participation
- I am willing to submit a pull request for this issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs responseIssue needs response from OPIssue needs response from OPneeds triageIssue needs to be triagedIssue needs to be triaged