vitejs / vite-plugin-react

The all-in-one Vite plugin for React projects.
MIT License
546 stars 102 forks source link

Failed to resolve entry for package "@vitejs/plugin-react". #340

Closed wanghaisheng closed 1 week ago

wanghaisheng commented 1 week ago

Describe the bug

Failed to resolve entry for package "@vitejs/plugin-react".

conf.ts

import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], server: { proxy: { '/api': 'http://localhost:8080', '/images': 'http://localhost:8080', }, }, });

Reproduction

https://github.com/jnsangalang/ad-astral-express/tree/main/client

Steps to reproduce

this my first time try to compile and run a vite repo

System Info

System:
    OS: Linux 5.10 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (16) x64 AMD Ryzen 7 4800H with Radeon Graphics
    Memory: 6.99 GB / 7.45 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.15.0 - /usr/bin/node
    npm: 10.7.0 - /usr/bin/npm
    pnpm: 9.4.0 - /usr/bin/pnpm
  npmPackages:
    @vitejs/plugin-react: ^4.3.1 => 4.3.1 System:
    OS: Linux 5.10 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (16) x64 AMD Ryzen 7 4800H with Radeon Graphics
    Memory: 6.99 GB / 7.45 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.15.0 - /usr/bin/node
    npm: 10.7.0 - /usr/bin/npm
    pnpm: 9.4.0 - /usr/bin/pnpm
  npmPackages:
    @vitejs/plugin-react: ^4.3.1 => 4.3.1

Used Package Manager

npm

Logs

No response

Validations

hi-ogawa commented 1 week ago

The issue is probably specific to the repo, so you need to check with the author there about their specific setup.