question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ViewDeestroyedError when click closing notification

See original GitHub issue

Hey, I’m getting this error when I click the notification for it to disappear.

Uncaught Error: ViewDestroyedError: Attempt to use a destroyed view: detectChanges
    at viewDestroyedError (core.js:9800)
    at Object.debugUpdateDirectives [as updateDirectives] (core.js:14652)
    at checkAndUpdateView (core.js:13802)
    at callWithDebugContext (core.js:15056)
    at Object.debugCheckAndUpdateView [as checkAndUpdateView] (core.js:14593)
    at ViewRef_.detectChanges (core.js:11577)
    at eval (angular2-notifications.umd.js:535) <----------- HERE
    at ZoneDelegate.invoke (zone.js:388)
    at Object.onInvoke (core.js:4749)
    at ZoneDelegate.invoke (zone.js:387)

This is very bad for performance as this error hits 365 times in my app because it executes change detection though the entire component tree. This error is coming from Angular’s changed detection running right after it’s destroyed, looking for it. I’m not sure how to fix it though, or prevent it maybe in the source code for angular2-notifications

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:3
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
flauccommented, Apr 28, 2018

yes @davidalee you’re right as far as I can tell it isn’t connected. It looks like it errors out when the notification is manually destroyed at the same time as it’s being animated out.

1reaction
pmitriforkcommented, Mar 6, 2018

I had the same issue today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ViewDestroyedError when click closing Angular2-notification ...
I'm getting this error when I click the notification for close.it seems to occur randomly. zone.js:196 Uncaught Error: ViewDestroyedError: ...
Read more >
Angular - Testing - API Manual
This guide offers tips and techniques for unit and integration testing Angular applications. The guide presents tests of a sample application created with ......
Read more >
ng2-completer | Yarn - Package Manager
If true will open and close the dropdown by click. boolean, No, false. selectOnFocus, If true will select the input text upon focus....
Read more >
attempt to use a destroyed view: detectchanges - OSCHINA
after click', async(() => { builder.createAsync(HelloWorld).then((fixture: ComponentFixture<HelloWorld>) => { fixture.detectChanges(); let el = fixture.
Read more >
View Raw - UNPKG
... **modal:** fix anchor for esc closing option demo ... **typeahead:** apply existing text on focus and click with typeaheadMinLength = 0 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found