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.

Invalid ngOnDestroy invocation on multiple provision

See original GitHub issue

🐞 bug report

Affected Package

core? 9.0.0. Would like to know

Is this a regression?

It occured after

Yes, the previous version in which this bug was not present was: ....

Description

Not sure whether it is connected with https://github.com/angular/angular/issues/35167 or not, but following screen shows an error: image in summary, those services in array - all of them implements some interface and are provided with the same token, under provision with multiple: true. As you see, ngOnDestroy is invoked on that array, but this this… eh, I don’t think that this array extends Subscriber. I have also noticed that this is not always the case.

🔥 Exception or Error


ERROR Error: Uncaught (in promise): TypeError: this.clearSubscriptions is not a function
TypeError: this.clearSubscriptions is not a function
    at Array.ngOnDestroy (subscriber.ts:28)
    at executeOnDestroys (core.js:14024)
    at cleanUpView (core.js:13931)
    at destroyViewTree (core.js:13705)
    at destroyLView (core.js:13882)
    at RootViewRef.destroy (core.js:14737)
    at ComponentRef$1.destroy (core.js:33528)
    at RouterOutlet.deactivate (router.js:8912)
    at ActivateRoutes.deactivateRouteAndOutlet (router.js:3963)
    at ActivateRoutes.deactivateRouteAndItsChildren (router.js:3921)
    at resolvePromise (zone-evergreen.js:793)
    at resolvePromise (zone-evergreen.js:752)
    at zone-evergreen.js:854
    at ZoneDelegate.invokeTask (zone-evergreen.js:400)
    at Object.onInvokeTask (core.js:40744)
    at ZoneDelegate.invokeTask (zone-evergreen.js:399)
    at Zone.runTask (zone-evergreen.js:168)
    at drainMicroTaskQueue (zone-evergreen.js:570)
    at invokeTask (zone-evergreen.js:485)
    at ZoneTask.invoke (zone-evergreen.js:470)

🌍 Your Environment

Angular Version:


Angular CLI: 9.0.1
Node: 12.13.1
OS: win32 x64

Angular: 9.0.0
... animations, cdk, common, compiler, compiler-cli, core
... elements, forms, language-service, material
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.900.1
@angular-devkit/build-angular      0.900.1
@angular-devkit/build-ng-packagr   0.900.1
@angular-devkit/build-optimizer    0.900.1
@angular-devkit/build-webpack      0.900.1
@angular-devkit/core               8.3.23
@angular-devkit/schematics         8.3.23
@angular/cli                       9.0.1
@ngtools/webpack                   9.0.1
@schematics/angular                8.3.23
@schematics/update                 0.900.1
ng-packagr                         9.0.0
rxjs                               6.5.4
typescript                         3.7.5
webpack                            4.41.2

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
crisbetocommented, Feb 21, 2020

It’s going to be fixed, but we decided to decouple the fix from #35249.

0reactions
angular-automatic-lock-bot[bot]commented, May 8, 2020

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RxJS: takeUntil() Angular component's ngOnDestroy()
I have an Angular component that opens several Rxjs subscriptions. These need to be closed when the component is destroyed. A simple solution...
Read more >
ngOnInit() May Not Get Called Before ngOnDestroy() Is Called ...
Ben Nadel demonstrates that the ngOnInit() and ngOnDestroy() life-cycle methods in Angular 4.4.6 are not invoked symmetrically.
Read more >
A Deep Dive into Angular's NgOnDestroy - Wesley Grimes
NgOnDestroy is a lifecycle method that can be added by implementing OnDestroy on the class and adding a new class method named ngOnDestroy...
Read more >
Single-page application: Acquire a token to call an API
The pattern for acquiring tokens for APIs with MSAL.js is to first attempt a silent token request by using the acquireTokenSilent method. When ......
Read more >
Creating a custom form field control - Angular Material
stateChanges = new Subject<void>(); set value(tel: MyTel | null) { ... this. ... Our custom form field control consists of multiple inputs that...
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