Angular-cli: ng lint [project] --fix throws errors

Created on 13 Sep 2018  Â·  11Comments  Â·  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [x ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

â–¶node --version
v8.11.4

~/_git/vikings  master ✗                                                           17h28m ⚑  
â–¶npm -v
5.6.0

Angular CLI: 6.2.1
Node: 8.11.4
OS: darwin x64
Angular: 6.1.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.0
@angular-devkit/build-angular     0.6.0
@angular-devkit/build-optimizer   0.6.0
@angular-devkit/core              0.6.0
@angular-devkit/schematics        0.8.1
@angular/cdk                      6.4.7
@angular/cli                      6.2.1
@angular/material                 6.4.7
@ngtools/webpack                  6.0.0
@schematics/angular               0.8.1
@schematics/update                0.8.1
rxjs                              6.3.2
typescript                        2.9.2
webpack                           4.6.0

Repro steps


either ng lint projectname --fix or ng lint --fix

The log given by the failure

All files pass linting.
sink._addParentTeardownLogic is not a function
TypeError: sink._addParentTeardownLogic is not a function
    at Observable.subscribe (/Users/papa/_git/vikings/node_modules/rxjs/internal/Observable.js:27:18)
    at /Users/papa/_git/vikings/node_modules/@angular/cli/node_modules/rxjs/internal/util/subscribeToObservable.js:10:20
    at Object.subscribeToResult (/Users/papa/_git/vikings/node_modules/@angular/cli/node_modules/rxjs/internal/util/subscribeToResult.js:7:45)
    at MergeMapSubscriber._innerSub (/Users/papa/_git/vikings/node_modules/@angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:75:38)
    at MergeMapSubscriber._tryNext (/Users/papa/_git/vikings/node_modules/@angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:72:14)
    at MergeMapSubscriber._next (/Users/papa/_git/vikings/node_modules/@angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:55:18)
    at MergeMapSubscriber.Subscriber.next (/Users/papa/_git/vikings/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:64:18)
    at MapSubscriber._next (/Users/papa/_git/vikings/node_modules/@angular/cli/node_modules/rxjs/internal/operators/map.js:52:26)
    at MapSubscriber.Subscriber.next (/Users/papa/_git/vikings/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:64:18)
    at TapSubscriber._next (/Users/papa/_git/vikings/node_modules/@angular/cli/node_modules/rxjs/internal/operators/tap.js:62:26)

Desired functionality

it says it passes linting, but then throws an error, too

Mention any other details that might be useful

medium regression non-obvious

Most helpful comment

thanks. tried rm -rf node_modules package-lock.json and re ran npm i and it did not work.

i already updated everything reported by ng update.

i just manually updated from 0.6.0 to "@angular-devkit/build-angular": "~0.8.1" and then the error goes away when i run ng lint --fix

Perhaps we can have a clearer error with a suggestion?

Or perhaps we can have ng update also check the devkit? (because it didnt tell me anything about it)

All 11 comments

Thats an rxjs issue when there are multiple versions of rxjs mainly 6.3.0 - 6.3.1 with 6.2.X https://github.com/ReactiveX/rxjs/issues/4077

This should have been fixed in RXJS 6.3.2. However, if you have rxjs as a transitive dependency between 6.3.0 amd 6.3.1 it will still fail.

Couple of things you might want to try, remove the lock and node_modules and try again, Or update the devkit and angular-cli packages to the latest versions as we pinned down the rxjs package.

If the issue still happends when not having any transitive dependency between 6.3.0 and 6.3.1, we might need to open a new issue with rxjs.

thanks. tried rm -rf node_modules package-lock.json and re ran npm i and it did not work.

i already updated everything reported by ng update.

i just manually updated from 0.6.0 to "@angular-devkit/build-angular": "~0.8.1" and then the error goes away when i run ng lint --fix

Perhaps we can have a clearer error with a suggestion?

Or perhaps we can have ng update also check the devkit? (because it didnt tell me anything about it)

Opened a new issue with rxjs https://github.com/ReactiveX/rxjs/issues/4135

For me, this happened when I updated RxJS. My package.json specifies ^6.0.0 but @angular-devkit/architect, @angular-devkit/schematics, @schematics/update, and @angular/cli all wanted ~6.2.0. I ended up with RxJS 6.2.2 and RxJS 6.3.2 installed in my project.

@cmckni3 did you manage to work around this?

In my case ionic stops working. Ionic internally runs ng run app:serve --host=0.0.0.0 --port=8100.

@davl3232 yes, I changed RxJS in my package.json to ~6.2.2.

If I use version 6.2.2 I have no problem with lint.

Does anyone know why the updated version has this problem?

This has been fixed with RXJS 6.3.3

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._

Was this page helpful?
0 / 5 - 0 ratings