Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng lint [project] --fix throws errors #12262

Closed
johnpapa opened this issue Sep 13, 2018 · 11 comments
Closed

ng lint [project] --fix throws errors #12262

johnpapa opened this issue Sep 13, 2018 · 11 comments

Comments

@johnpapa
Copy link
Contributor

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

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Sep 13, 2018

Thats an rxjs issue when there are multiple versions of rxjs mainly 6.3.0 - 6.3.1 with 6.2.X ReactiveX/rxjs#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.

@johnpapa
Copy link
Contributor Author

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)

@alan-agius4
Copy link
Collaborator

Opened a new issue with rxjs ReactiveX/rxjs#4135

@peterramaldes
Copy link

peterramaldes commented Sep 18, 2018

Same here http://prntscr.com/kvwkk2

@cmckni3
Copy link

cmckni3 commented Sep 24, 2018

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.

@davl3232
Copy link

@cmckni3 did you manage to work around this?

@davl3232
Copy link

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

@cmckni3
Copy link

cmckni3 commented Sep 24, 2018

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

@peterramaldes
Copy link

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

Does anyone know why the updated version has this problem?

@alan-agius4
Copy link
Collaborator

This has been fixed with RXJS 6.3.3

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants