javascript 如何解决React网站加载后出现的黑屏问题?

euoag5mw  于 2023-06-04  发布在  Java
关注(0)|答案(1)|浏览(592)

Error messages can be seen in photo我的终端没有错误,我的网站完全能够加载。然而,当我打开我的开发工具。我能够加载我的网站,然后我尝试做一些样式的变化。我恢复了我的网站不保存任何样式的变化。我无法看到我的网站。它加载,然后出现黑屏。我看到以下错误消息:

The above error occurred in the <div> component:

    at div

React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.

react_devtools_backend_compact.js:2367 The above error occurred in the <ForwardRef(Canvas)> component:

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.
overrideMethod @ react_devtools_backend_compact.js:2367

react-dom.development.js:26923 Uncaught Error: R3F: Div is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively

我尝试删除我的节点模块和pack.lock json文件,并运行npm i和npm install。这并没有解决问题。不知道发生了什么事。

b0zn9rqh

b0zn9rqh1#

删除
fallback={}在computers.jsx文件中。
然后运行npm运行dev它的语法错误导致所有其他错误在开发工具

相关问题