简体   繁体   English

如何在没有信息的情况下调试角度误差

[英]how to debug angular error with no information

I get an error `ERROR Error: "[object Object]" in my console and my app just has a white screen. 我在控制台中收到一个错误`ERROR错误:“ [对象对象]”,我的应用程序只有白色屏幕。 It was working fine, and I can't think what I've changed if anything. 一切正常,我想都不能改变。 It shows as being in core.js not my code so how can I debug this? 它显示为在core.js中而不是我的代码中,那么如何调试呢?

My app is Angular version 7. Along time ago it was version 2, but has been upgraded over time. 我的应用程序是Angular版本7。很久以前它是版本2,但是随着时间的推移已经升级。

在此处输入图片说明

Convert your object into json format 将您的对象转换为json格式

if you use pipe line easy to print data 如果您使用管道容易打印数据

let item of array | json

in ngfor loop 在ngfor循环中

Figured it out. 弄清楚了。 I had added code which tried to read environment variables from process.env . 我添加了试图从process.env读取环境变量的代码。 I figured this out by slowly reviewing all code that had gone in to the code base recently. 我通过慢慢查看最近进入代码库的所有代码来解决这个问题。 Hope Angular gets better debugging soon. 希望Angular尽快得到更好的调试。 App built successfully with no error, yet failed at run time with no hint as to where in my code it was. 应用程序成功构建,没有错误,但在运行时失败,没有提示我的代码在哪里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM