在终端中显示的VSCODE使用什么命令或过程,负责在ReactJ中显示空白页的代码行?

发布于 2025-02-05 01:44:48 字数 471 浏览 2 评论 0原文

我正在使用ReactJS进行Web项目。一段时间以来,每当我在VSCODE上运行代码时,浏览器都会向我显示一个不错的空白页。我不知道为什么,因为它以前没有发生,我没有对源代码进行任何更改。我在网上读了一篇文章,该文章说这是由于我的代码中发生的错误。但是,尽管如此,我还是不明白的,因为即使在此空白页面问题之前,我的代码中经常出现错误,并在网页上向我展示了我的应用程序,而不是应用程序的黑色页面,其中包含详细信息和行错误。但是现在什么都没有,只有一个空白页,在命令行中,没有向我报告错误,只有警告。在互联网上阅读文章后,我意识到我可以在组件上使用错误界限来防止这种情况,但是因为对于某些原因 效率我无法在所有组件上使用错误限制,因此我必须在负责崩溃的元素上使用它。但是问题在于,我不知道哪个元素对此负责,并且VSCODE并未向我显示有关崩溃的信息。尽管如此,根据官方文档,VSCODE应该提供我的页面崩溃的详细信息以及错误的位置,并且我使用的是16岁以上的React版本。我不知道该怎么做或使用什么资源。所以我寻求您的帮助。谢谢!

I'm working on a web project with reactjs. For some time, whenever I run my code on vscode, the browser shows me a nice blank page. I don't know why because it didn't happen before and I didn't make any changes to the source code. I read an article on the web that said it was due to an error that occurred in my code. But despite that, I don't understand because even before this blank page problem, I often had errors in my code and react showed me on the web page instead of the application a black page with the details and the lines errors occurred. But now nothing, just a blank page and in the command line, no errors are reported to me, just warnings.After reading an article on the internet, I realized that I could use error bounds on components to prevent this, but since for some reason
efficiency I couldn't use error limits on all my components, so I had to use it on the element responsible for the crash. But the problem is that I don't know which element is responsible for this and vscode doesn't show me information about the crash. Still, according to the official documentation, vscode should give details of my page crash as well as the location of the error and I'm using a react version greater than 16. I don't know what to do or what resource to use. So I ask for your help. Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文