最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - What does TypeError non_object_property_load mean? - Stack Overflow

programmeradmin0浏览0评论

I see this error a bunch in javascript that I'm debugging. In the JS console Chrome says something very similar to

TypeError
    arguments: Array[2]
    message: "-"
    stack: "-"
    type: "non_object_property_load"
    __proto__: Error

I can usually work my way to the underlying problem, but in general what does the error represent?

Is there any way to get a stack trace to the line that caused the problem?

I see this error a bunch in javascript that I'm debugging. In the JS console Chrome says something very similar to

TypeError
    arguments: Array[2]
    message: "-"
    stack: "-"
    type: "non_object_property_load"
    __proto__: Error

I can usually work my way to the underlying problem, but in general what does the error represent?

Is there any way to get a stack trace to the line that caused the problem?

Share Improve this question asked Oct 12, 2011 at 20:05 LeopdLeopd 42.8k32 gold badges135 silver badges172 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 21

You're trying to access something from null or undefined.

For example, this code will throw such an error:

null.foo;

You should check which properties you're accessing from which objects, and use something like obj && obj.prop instead of just obj.prop.


You can get the stack trace using:

console.log(new Error().stack);

The - means the property is a getter, and is not displayed automatically because a getter can have side effects. The stack is available though (the - does not mean "not available"); you just have to access it explicitly.

发布评论

评论列表(0)

  1. 暂无评论