Skip to content

Sourcemap warning for "@react-refresh" in new vite project when running browser tests #474

@wuifdesign

Description

@wuifdesign

Related plugins

Describe the bug

When running browser tests using Vitest's browser testing guide, I get the following warning:

Sourcemap for "/@react-refresh" points to missing source files
I set up a new project and am seeing this warning right from the start, before adding any custom code. Let me know if there's any additional info or reproduction steps you'd like.

Tests are running fine, it just shows this warning.

Not seeing this warning when using @vitejs/plugin-react.

Reproduction

https://github.com/wuifdesign/react-swc-bug

Steps to reproduce

check out the repo and run npm run test:browser

Also added @vitejs/plugin-react to the repo to see the warning is gone after switching to this package.

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12700K
    Memory: 11.65 GB / 31.80 GB
  Binaries:
    Node: 20.12.2 - C:\Program Files\nodejs\node.EXE
    npm: 10.4.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.86)
  npmPackages:
    @vitejs/plugin-react: ^4.4.1 => 4.4.1 
    @vitejs/plugin-react-swc: ^3.9.0 => 3.9.0 
    vite: ^6.3.4 => 6.3.4

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions