-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Astro Info
Astro v5.15.0
Vite v6.4.1
Node v22.14.0
System macOS (arm64)
Package Manager npm
Output static
Adapter none
Integrations none
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When editing a content collection file during development, changes are not reflected automatically after using the browser’s Back button.
If a content value is modified while the user is on a page that doesn’t use that data, navigating back to a page that does use it still shows the old value.
The update only appears after a full browser refresh or using a link to this page.
Example Project
A minimal reproduction (see link below) includes two pages:
- Index.astro
- Displays a value from a content collection
- Includes a link to
/other
- Other.astro
- Does not use the content collection
- Includes a link back to
/
Steps to Reproduce
- This cannot be reproduced on stackblitz. Clone the github repository to reproduce the issue.
- Start the dev server:
npm run dev - Open http://localhost:4321/
- Click “Link to other site” to navigate to /other
- In the project, edit:
./src/counter/abc.json. Change "counter" from0to43. - Use browser back navigation (not the link labeled "Back") to return to
/
Actual Result
The counter value remains 0 (the old value).
The page does not refresh automatically to reflect the change.
What's the expected result?
When navigating back, the page should detect that content collection data has changed and automatically refresh to show the new value (43) — without requiring a manual reload.
Notes
- The automatic refresh works correctly when navigating via internal links (for example, using the “Back” link on the
/otherpage). - The issue only occurs when using the browser’s native back navigation after editing a content collection file.
Link to Minimal Reproducible Example
https://github.com/smn-cds/reproduce-content-collection-update
Participation
- I am willing to submit a pull request for this issue.