DEV Community

Discussion on: Uncaught TypeError: Cannot read property 'xyz' of undefined

 
jwp profile image
John Peters • Edited

In the breakpoint there should be a value for id and it's container object.

Thread Thread
 
jwp profile image
John Peters

App module is a part of bootstrap. Very early in run. I'm not sure why it wouldn't be first thing loaded.

Thread Thread
 
keyboardbreaker profile image
Yu-Jin

ok this is pretty much a failing on my behalf but I think you didnt make clear that you can step over to the next function call from that breakpoint, i just assumed that the breakpoint would show the culprit from the start.

which I never, hence it stops at the very beginning, app.module.

Thread Thread
 
keyboardbreaker profile image
Yu-Jin

this is a lifesaver. seriously! It confuses me to think I didn't try to step over from the breakpoint. was not thinking straight!

so my culprit module was: angular2-toaster, and in turn shall need to update it to: ngx-toastr

Thank you so much! :)

Thread Thread
 
jwp profile image
John Peters

Yes, I even created a bug with Angular team because they force the user to set breakpoints in their code to determine root cause. They should at least bubble the module name upward. But I'm finding that the Angular team, in general has no standards on error messaging throughout their code. This causes great pain down the road...