Skip to content

Cached dependencies not matching on Windows #1394

Description

@sbossarte

Describe the bug

On Windows, editing a file that a Svelte style block depends on through a preprocessor doesn't seem to get picked up/reprocessed in some circumstances (in this case, a postcss plugin injecting shared mixin definitions). You still see an HMR message go by in the terminal for the component, but whatever comes back afterward still looks like it's from before the edit. Only fully restarting the dev server picks up the change.

More notes in the repro repo, but my best guess is DependenciesCache in plugins/preprocess.js is comparing paths that aren't always in the same format when it comes time to handle preprocessors for files changing. Tried the same thing with a plain SCSS @use dependency and couldn't get the same behavior. Perhaps a difference in how Sass or PostCSS report file paths themselves.

Reproduction URL

https://github.com/sbossarte/vps-hmr-repro

Reproduction

  1. npm ci
  2. npm run dev
  3. Confirm the heading text is red (from src/mixins.pcss's --label-color mixin).
  4. Edit src/mixins.pcss, change red to blue, save
  5. Expected: the heading turns blue without a page reload.
  6. Actual (Windows only): the heading stays red. Only restarting the server entirely picks up the change.

Logs

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (32) x64 AMD Ryzen 9 9950X3D 16-Core Processor
    Memory: 22.66 GB / 61.56 GB
  Binaries:
    Node: 22.15.0 - F:\Programs\nodejs\node.EXE
    npm: 11.6.2 - F:\Programs\nodejs\npm.CMD
  Browsers:
    Firefox: 147.0.4 - C:\Program Files\Mozilla Firefox\firefox.exe
  npmPackages:
    @sveltejs/vite-plugin-svelte: ^7.2.0 => 7.2.0
    svelte: ^5.0.0 => 5.56.8
    vite: ^8.2.1 => 8.2.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageAwaiting triage by a project member

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions