Skip to content

Dev server serves stale content in common files with Astro6 + Storyblok #16754

@DaveZIvy

Description

@DaveZIvy

Astro Info

For my actual repo:
Astro                    v6.3.3
Node                     v24.15.0
System                   macOS (arm64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/node
Integrations             @astrojs/react
                         @astrojs/mdx
                         @astrojs/sitemap
                         @storyblok/astro
                         optimizeRoutes
                         decodeClassNames

For the minimal reproduction
Astro                    v6.3.3
Node                     v22.22.0
System                   Linux (x64)
Package Manager          unknown
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

On an Astro + Storyblok monorepo with shared components in a sibling folder:

sites/
  common/         ← shared .astro components live here
    layouts/
      Blog.astro
  dallas/         ← one of several Astro sites
    src/
      pages/
    astro.config.mjs
  nevada/
  ...

When I updated to Astro6, changes to files in the common/ folder (like sites/common/layouts/Blog.astro) are only shown in the browser if I kill and restart the server (this was not an issue in Astro4 or Astro5).

I tried a few things including writing a custom integration to manually invalidate the module graph and logging confirms invalidation is walking the full importer chain:

invalidating /@fs/.../sites/common/layouts/Blog.astro
invalidating virtual:import-storyblok-components
invalidating /src/styles/tailwind.css

The target module shows invalidationState: 'HARD_INVALIDATED' and transformResult: null in both client and ssr environments. But the page still shows stale content after browser reload.

I created a VERY basic reproduction of the issue on stackblitz , to get it to work

  1. Run npm install && npm run dev -w dallas -- --host
  2. The browser loads and shows "test [...all].astro test blog"
  3. Update sites/common/layouts/Blog.astro
  4. Refresh the browser
  5. The update doesn't show up
  6. Kill the server & restart it
  7. Now the update does show up

What's the expected result?

Saving a change in a common file, like sites/common/layouts/Blog.astro, then refreshing the browser should show the updated content in the common file.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-ah7hn2d7?file=sites%2Fcommon%2Flayouts%2FBlog.astro

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P4: importantViolate documented behavior or significantly impacts performance (priority)pkg: astroRelated to the core `astro` package (scope)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions