Rxjs: RxJS 6.2.x trustedSubscriber._addParentTeardownLogic is not a function error

Created on 4 Sep 2018  路  19Comments  路  Source: ReactiveX/rxjs

We are developing Cordova Application using Bootstrap 4 and Angular 6. We upgraded RxJS version to 6.3.1. When we launch the Application in Samsung Mobile Device, its stuck in Splash screen and we are not getting any error message in the browser console.

So when we reverted both rxjs and rxjs-compat to V6.0.0, 6.1.0, 6.2.x. We are getting trustedSubscriber._addParentTeardownLogic is not a function. Error.

Ng Version:

Package Version

@angular-devkit/architect 0.6.8
@angular-devkit/build-angular 0.6.8
@angular-devkit/build-optimizer 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@angular/cli 6.0.8
@angular/compiler-cli 6.0.7
@ngtools/webpack 6.0.8
@schematics/angular 0.6.8
@schematics/update 0.6.8
rxjs 6.2.2
typescript 2.7.2
webpack 4.8.3

Error Log:

Reproduction
We cannot share StackBlitz because our application is cordova based mobile app

Environment
Andriod, IOS

  • RxJS version:
  • 6.1.x, 6.2.x
    rxjs screenshot

Most helpful comment

Fixed by enforcing 6.3.2 for all dependencies.

Add to package.json

  "resolutions": {
    "**/rxjs": "6.3.2"
  },

All 19 comments

See #4077.

Not seeing any solution for above problem in #4077.

@nabzzz right now it is difficult to reproduce using a simple boilerplate app. Working on reproducing on a large scale app today to find out what is happening - if I can.

Our application is a huge one around 45,000-50,000 lines of code. We started developing this application in Angular 2, then we upgraded to 4, 5 and 6. We are facing this issue after Rxjs v6.3.1 got released. Previously it's working fine. We tried to downgrade Angular CLI to 6.0.7, 6.0.8 . Its n't fixing the problem.

@sureshdotariya what about when you go back a version in RxJS?

We downgraded to RxJS V6.0.0, 6.1.x, 6.2.x. Still the same error.
Tried downgraded Angular CLI from 6.1.x to 6.0.7 and 6.0.8. But still same error.

@sureshdotariya did you check to make sure that the node_modules did indeed get pruned and there is nothing cached? Possibly blowing away node_modules and doing install again?

Yes, we also did 'npm cache clean --force' before 'npm install'. But no luck its same error.

Finally we able to resolve this issue. Using Angular CLI V6.0.8 with Rxjs V6.3.1.

This issue has been resolved in RxJS 6.3.2. The problem was that there were mixed versions of RxJS under node_modules from different dependencies, and RxJS 6.3.0 and 6.3.1 Subscribers didn't know how to deal with other RxJS 5 and 6 subscribers.

Resolved by #4078

I have upgraded to the latest version of RxJS but the problem still persists. I also tried with clean installation of node_modules with no luck. Below is my configuration:

Angular CLI: 6.1.5
Node: 8.11.4
OS: win32 x64
Angular: 6.1.6
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package Version

@angular-devkit/architect 0.6.3
@angular-devkit/build-angular 0.6.3
@angular-devkit/build-optimizer 0.6.3
@angular-devkit/core 0.7.5
@angular-devkit/schematics 0.7.5
@angular/cdk 6.4.7
@angular/cli 6.1.5
@angular/material 6.4.7
@ngtools/webpack 6.0.3
@schematics/angular 0.7.5
@schematics/update 0.7.5
rxjs 6.3.2
typescript 2.9.2
webpack 4.8.3

@bampakoa can you grep your node_modules directory for rxjs in all package.json files to see if there are any conflicts in version numbers.

@bampakoa You should be able to get npm to list all rxjs packages - and their versions - under node_modules by running:

npm list rxjs

I solved the problem by doing these steps

npm install --save-dev @angular/[email protected]
npm cache clean --force

npm install //this will install rxjs 6.3.2
npm install [email protected]

Same problem (I do not open a new issue for that), angular 5 updated to 6, with:

sink._addParentTeardownLogic(this.source || (config_1.config.useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?
^

TypeError: sink._addParentTeardownLogic is not a function

"dependencies": {
"@angular/animations": "^6.1.6",
"@angular/common": "^6.1.6",
"@angular/compiler": "^6.1.6",
"@angular/core": "^6.1.6",
"@angular/forms": "^6.1.6",
"@angular/http": "^6.1.6",
"@angular/platform-browser": "^6.1.6",
"@angular/platform-browser-dynamic": "^6.1.6",
"@angular/router": "^6.1.6",
"@ng-bootstrap/ng-bootstrap": "^3.2.0",
"bootstrap": "^4.1.3",
"chart.js": "^2.7.2",
"core-js": "^2.4.1",
"jquery": "^3.3.1",
"ng2-charts": "^1.6.0",
"popper.js": "^1.14.4",
"rxjs": "^6.3.2",
"rxjs-compat": "^6.2.2",
"zone.js": "^0.8.14"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.7.0-rc.3",
"@angular/cli": "^6.0.8",
"@angular/compiler-cli": "^6.1.6",
"@angular/language-service": "^6.1.6",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "~3.2.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "^2.0.4",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "^5.4.0",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.9.2"
}

Not solved with sureshdotariya indication

This is the output from the command as suggested by @cartant and @pertrai1 . Thanks for the help guys!

+-- @angular-devkit/[email protected]
| +-- @angular-devkit/[email protected]
| | +-- @angular-devkit/[email protected]
| | | `-- [email protected]  deduped
| | `-- [email protected]
| +-- @angular-devkit/[email protected]
| | `-- [email protected]  deduped
| +-- @ngtools/[email protected]
| | `-- @angular-devkit/[email protected]
| |   `-- [email protected]
| `-- [email protected]
+-- @angular/[email protected]
| +-- @angular-devkit/[email protected]
| | `-- [email protected]  deduped
| +-- @angular-devkit/[email protected]
| | `-- [email protected]  deduped
| +-- @angular-devkit/[email protected]
| | `-- [email protected]  deduped
| +-- @schematics/[email protected]
| | `-- [email protected]  deduped
| `-- [email protected]  deduped
`-- [email protected]

TypeError: sink._addParentTeardownLogic is not a function solved

4070

12072

I can confirm that the issue is resolved using Angular CLI 6.2.1

Fixed by enforcing 6.3.2 for all dependencies.

Add to package.json

  "resolutions": {
    "**/rxjs": "6.3.2"
  },
Was this page helpful?
0 / 5 - 0 ratings

Related issues

giovannicandido picture giovannicandido  路  4Comments

chalin picture chalin  路  4Comments

benlesh picture benlesh  路  3Comments

unao picture unao  路  4Comments

jakovljevic-mladen picture jakovljevic-mladen  路  3Comments