我正在尝试使用 Vite 创建一个新的 React 应用程序。到目前为止我所做的是运行命令npm create vite@latest
。我能够创建应用程序,运行 npm install,npm run dev 在本地主机上运行它。但是当我打开控制台时,出现错误消息,并且我在互联网上找不到任何解决方案来修复它。这是错误:
Uncaught (in promise) Error: Minified React error #321; visit https://reactjs.org/docs/error-decoder.html?invariant=321 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at it (blur.js:42:3933)
at s.useContext (blur.js:42:5675)
at cr (blur.js:57:31858)
at blur.js:61:494
at blur.js:126:5191
at Generator.next (<anonymous>)
at I (blur.js:126:4967)
Run Code Online (Sandbox Code Playgroud)
我使用 Git Bash 创建了应用程序,但出现了错误。然后我尝试使用Windows PowerShell,结果是一样的。即使我没有对代码进行任何更改,但在运行“npm run dev”后立即出现错误
这是我有的包:
{
"name": "sikka-patient-portal",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@reduxjs/toolkit": "^1.9.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.0.5",
"react-router-dom": "^6.8.2",
"redux": "^4.2.1",
"sass": "^1.58.3"
},
"devDependencies": {
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@vitejs/plugin-react": "^3.1.0",
"vite": "^4.1.0"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Run Code Online (Sandbox Code Playgroud)
有没有人有办法解决吗?非常感谢!
我尝试使用不同的终端(git bash、windows powershell)创建应用程序,并在网上寻找解决方案,但找不到任何解决方案。
小智 31
我今天也得到了......根据我的理解,它似乎没有链接到您/我们的代码库。在我这边,它似乎链接到 Chrome 扩展 (Loom)。我禁用它后,这个错误就消失了
归档时间: |
|
查看次数: |
3090 次 |
最近记录: |