Skip to content

plugin-react 1.0.6 triggers sourcemap and deoptimisation error/warning messages in dev server #5438

Closed
@lucsky

Description

Describe the bug

In a Vite+React project using version 1.0.6 of plugin-react, running yarn run vite serve and then accessing the server triggers a bunch of the following error messages:

Sourcemap for "/Users/luc/Code/myproj/node_modules/.vite/react-dom.js" points to missing source files
Sourcemap for "/Users/luc/Code/myproj/node_modules/.vite/react.js" points to missing source files
Sourcemap for "/Users/luc/Code/myprojvite/react-router-dom.js" points to missing source files
(... and more)

Reproduction

yarn create vite --template react test
cd test
yarn install
yarn run vite serve --open

This will trigger the following messages for me, when doing this in my Desktop folder:

[BABEL] Note: The code generator has deoptimised the styling of /Users/luc/Desktop/test/node_modules/.vite/react-dom.js?v=5ffcdbe8 as it exceeds the max of 500KB.
Sourcemap for "/Users/luc/Desktop/test/node_modules/.vite/react.js" points to missing source files
Sourcemap for "/Users/luc/Desktop/test/node_modules/.vite/react_jsx-dev-runtime.js" points to missing source files
Sourcemap for "/Users/luc/Desktop/test/node_modules/.vite/react-dom.js" points to missing source files

Forcing use of version 1.0.5 of plugin-react "fixes" the error messages:

yarn add --dev @vitejs/plugin-react@1.0.5

System Info

System:
    OS: macOS 12.0.1
    CPU: (8) x64 Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
    Memory: 1015.09 MB / 32.00 GB
    Shell: 3.3.1 - /usr/local/bin/fish
  Binaries:
    Node: 17.0.1 - /usr/local/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.1.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 95.0.4638.54
    Firefox: 93.0
    Firefox Developer Edition: 90.0
    Safari: 15.1
    Safari Technology Preview: 15.4
  npmPackages:
    @vitejs/plugin-react: ^1.0.0 => 1.0.6
    vite: ^2.6.4 => 2.6.12

Used Package Manager

yarn

Logs

No response

Validations

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions