快 - "Source map points to missing source files"

Vite - "Source map points to missing source files"

几乎所有安装的模块都突然出现这个错误。

“C:/.../node_modules/.vite/react.js”的源映射指向丢失的源文件 “C:/.../node_modules/.vite/axios.js”的源映射指向丢失的源文件 “C:/.../node_modules/.vite/react-dom.js”的源映射指向丢失的源文件 “C:/.../node_modules/.vite//react_jsx-dev-runtime.js”的源映射指向丢失的源文件

package.json:

{
  "name": "ic-logistic",
  "version": "0.0.0",
    "proxy": "http://localhost:8080/",
  "private": true,
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "serve": "vite preview"
  },
  "dependencies": {
    "axios": "^0.24.0",
    "dotenv": "^10.0.0",
    "mapbox-gl": "^2.5.0",
    "react": "^17.0.0",
    "react-dom": "^17.0.0",
    "react-map-gl": "^6.1.17",
    "react-redux": "^7.2.5",
    "react-router-dom": "^5.3.0",
    "redux": "^4.1.1",
    "redux-devtools-extension": "^2.13.9",
    "sass": "^1.42.1"
  },
  "devDependencies": {
    "@vitejs/plugin-react": "^1.0.0",
    "vite": "^2.6.0"
  }
}

只需将 @vitejs/plugin-react 版本从 "^1.0.0" 更改为确切的版本 "1.0.5"。您可以在此线程中阅读有关此错误的更多信息:https://github.com/vitejs/vite/issues/5438