TraceKit icon indicating copy to clipboard operation
TraceKit copied to clipboard

Cannot read property 'name' of undefined

Open spoterala opened this issue 3 years ago • 2 comments

I've got an error like in title. It's in function computeStackTrace in last return when tries to get ex.name.

It is called by function traceKitWindowOnUnhandledRejection (and I don't have more stacktrace).

Could you tell me why I got this error?

spoterala avatar Jul 20 '21 13:07 spoterala

This is a function that is wired up to https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onunhandledrejection and handles this type of event. Sounds like that event can be null. Can you let us know how you reproduced it and with the specifics of what browser/os you were using with specific versions.

niemyjski avatar Jul 20 '21 13:07 niemyjski

I'm sorry, but I've seen that error only once and had some trouble getting it.

Steps to get this error:

  1. Call reject() in a Promise
  2. PromiseRejectionEvent is triggered
  3. The event is caught by traceKitWindowOnUnhandledRejection in TraceKit
  4. e.reason is undefined
  5. computeStackTrace gets undefied as a first argument

spoterala avatar Jan 12 '23 13:01 spoterala