Skip to content

[plugin:vite:import-analysis] Failed to resolve import "react/jsx-dev-runtime" from "src/main.tsx". Does the file exist? #391

@mrdulin

Description

@mrdulin

Describe the bug

Try to use vite with react 16.10.0, got the error when start the dev server

Reproduction

https://stackblitz.com/edit/vitejs-vite-q3yh8t?file=src%2Fmain.tsx

Steps to reproduce

  1. Remove the package-lock.json
  2. npm install && npm run dev

System Info

❯ npx envinfo --system --npmPackages '{vite,@vitejs/*}' --binaries --browsers
Need to install the following packages:
[email protected]
 

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @vitejs/plugin-react: ^4.3.4 => 4.3.4 
    vite: ^6.0.1 => 6.0.1

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions