我正在尝试使用 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": …Run Code Online (Sandbox Code Playgroud)