Skip to content

this.addWatchFile does not work as expected if base url is specified #19792

@anatawa12

Description

@anatawa12

Describe the bug

this.addWatchFile with absolute path / id does not actually watch file specified if base url path is specified.

When we removed the base url, it works.

Reproduction

https://github.com/anatawa12/add-watch-file-test-base-url.git

Steps to reproduce

npm install and then npm run dev, then open with your browser, and then edit test.txt.
After auto refresh we should see updated test.txt contents, but actually not.

System Info

System:
    OS: macOS 15.3.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 146.77 MB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.6.0 - /opt/n/bin/node
    Yarn: 1.22.22 - /opt/n/bin/yarn
    npm: 10.8.2 - /opt/n/bin/npm
    pnpm: 9.15.5 - /opt/n/bin/pnpm
  Browsers:
    Chrome: 134.0.6998.166
    Edge: 134.0.3124.95
    Safari: 18.3
  npmPackages:
    vite: ^6.2.0 => 6.2.5 

-----
I generally use Firefox but envinfo doesn't provide information. My Firefox version is 136.0.2 (aarch64)

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: hmrp3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions