Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

'Uncaught TypeError: Cannot set property stack of [object Object] which has only a getter' with Angular #427

@matthewsorenson-tr

Description

@matthewsorenson-tr

Hi, I observed this error when migrating to Angular RC6 with zone.js 0.6.17.
Error:

long-stack-trace-zone.js:135
Uncaught TypeError: Cannot set property stack of [object Object] which has only a getter
onHandleError @ long-stack-trace-zone.js:135
ZoneDelegate.handleError @ zone.js:336
onHandleError @ ng_zone_impl.js:60
ZoneDelegate.handleError @ zone.js:336
Zone.runTask @ zone.js:268
ZoneTask.invoke @ zone.js:433

I see that the error caught on zone.js:267 is a ViewWrappedError (which has a proto chain of WrappedError -> BaseError -> Error -> Object). On long-stack-trace-zone.js:123, descriptor ends up as null, which leads to long-stack-trace-zone.js:135, where error.stack cannot be set since WrappedError used Object.defineProperty and didn't define a setter.

Is this an issue with Angular or Zone.js?

Note: This error went away after I fixed the issue that was causing the exception to be thrown in the first place, but it still seems like incorrect error handling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions