Skip to content

Invalidate dev CSS map when routes change#15873

Merged
matthewp merged 1 commit intomainfrom
fix/dev-css-for-new-routes
Mar 12, 2026
Merged

Invalidate dev CSS map when routes change#15873
matthewp merged 1 commit intomainfrom
fix/dev-css-for-new-routes

Conversation

@matthewp
Copy link
Contributor

@matthewp matthewp commented Mar 12, 2026

Changes

Testing

  • Tested manually. Patched an example app, created a new page, new log was shown.

Docs

  • N/A (bug fix).

Regenerate the dev route-to-CSS map after route rebuilds so newly created pages in dev include layout-imported styles without requiring a server restart.
@changeset-bot
Copy link

changeset-bot bot commented Mar 12, 2026

🦋 Changeset detected

Latest commit: cea7745

The changes in this PR will be included in the next version bump.

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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Mar 12, 2026
@matthewp matthewp changed the title fix(astro): invalidate dev CSS map when routes change Invalidate dev CSS map when routes change Mar 12, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 12, 2026

Merging this PR will not alter performance

✅ 18 untouched benchmarks


Comparing fix/dev-css-for-new-routes (cea7745) with main (e0042f7)

Open in CodSpeed

@matthewp matthewp marked this pull request as ready for review March 12, 2026 13:34
@matthewp matthewp merged commit 35841ed into main Mar 12, 2026
26 checks passed
@matthewp matthewp deleted the fix/dev-css-for-new-routes branch March 12, 2026 13:52
@astrobot-houston astrobot-houston mentioned this pull request Mar 12, 2026
dadezzz pushed a commit to dadezzz/ice-notes that referenced this pull request Mar 17, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [astro](https://astro.build) ([source](https://github.com/withastro/astro/tree/HEAD/packages/astro)) | [`6.0.3` → `6.0.4`](https://renovatebot.com/diffs/npm/astro/6.0.3/6.0.4) | ![age](https://developer.mend.io/api/mc/badges/age/npm/astro/6.0.4?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/astro/6.0.3/6.0.4?slim=true) |

---

### Release Notes

<details>
<summary>withastro/astro (astro)</summary>

### [`v6.0.4`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#604)

[Compare Source](https://github.com/withastro/astro/compare/astro@6.0.3...astro@6.0.4)

##### Patch Changes

- [#&#8203;15870](withastro/astro#15870) [`920f10b`](withastro/astro@920f10b) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Prebundle `astro/toolbar` in dev when custom dev toolbar apps are registered, preventing re-optimization reloads that can hide or break the toolbar.

- [#&#8203;15876](withastro/astro#15876) [`f47ac53`](withastro/astro@f47ac53) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes `redirectToDefaultLocale` producing a protocol-relative URL (`//locale`) instead of an absolute path (`/locale`) when `base` is `'/'`.

- [#&#8203;15767](withastro/astro#15767) [`e0042f7`](withastro/astro@e0042f7) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fixes server islands (`server:defer`) not working when only used in prerendered pages with `output: 'server'`.

- [#&#8203;15873](withastro/astro#15873) [`35841ed`](withastro/astro@35841ed) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Fix a dev server bug where newly created pages could miss layout-imported CSS until restart.

- [#&#8203;15874](withastro/astro#15874) [`ce0669d`](withastro/astro@ce0669d) Thanks [@&#8203;ematipico](https://github.com/ematipico)! - Fixes a warning when using `prefetchAll`

- [#&#8203;15754](withastro/astro#15754) [`58f1d63`](withastro/astro@58f1d63) Thanks [@&#8203;rururux](https://github.com/rururux)! - Fixes a bug where a directory at the project root sharing the same name as a page route would cause the dev server to return a 404 instead of serving the page.

- [#&#8203;15869](withastro/astro#15869) [`76b3a5e`](withastro/astro@76b3a5e) Thanks [@&#8203;matthewp](https://github.com/matthewp)! - Update the unknown file extension error hint to recommend `vite.resolve.noExternal`, which is the correct Vite 7 config key.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41OS41IiwidXBkYXRlZEluVmVyIjoiNDMuNTkuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: Renovate Bot <renovate@zarantonello.dev>
Co-committed-by: Renovate Bot <renovate@zarantonello.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[v6] Unable to find CSS for <page>. This is likely a bug in Astro.

2 participants