Skip to content

[BUG] CSS issues & HMR for .astro files issue with dynamic import #16342

@jackholden

Description

@jackholden

Astro Info

Astro                    v6.1.6
Vite                     v7.3.2
Node                     v24.14.0
System                   macOS (arm64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/mdx (v5.0.3)

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

No response

Describe the Bug

When I make changes to my .astro files, the updates are not reflected as expected. Instead, I have to terminate and restart the development server for the changes to appear.

Reverting to version 6.0.6 partially resolves the issue; however, styles do not render until I press Cmd + S several times. After restarting the server, this process must be repeated.

I wonder if the behaviour is partially to do with the way I am dynamically importing as when I delete the hello-world directory and button is on it's own or vice versa (when there is only 1 item), it works as expected.

What's the expected result?

I expect my changes to show automatically when I press cmd + s. I don't expect to have to kill the server to see them.

Link to Minimal Reproducible Example

https://github.com/jackholden/astro-bug

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)needs triageIssue needs to be triagedpkg: 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