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

[ERROR] error running ng lint --fix #1132

Closed
1 task done
ghost opened this issue Sep 15, 2022 · 4 comments · Fixed by #1142
Closed
1 task done

[ERROR] error running ng lint --fix #1132

ghost opened this issue Sep 15, 2022 · 4 comments · Fixed by #1142
Labels
package: builder Angular CLI builder which enables executing ESLint in Angular CLI workspaces triage This issue needs to be looked at and categorized by a maintainer

Comments

@ghost
Copy link

ghost commented Sep 15, 2022

Description and reproduction of the issue

$ ng lint --fix
node:internal/process/promises:246
triggerUncaughtException(err, true /* fromPromise */);
^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#".] {
code: 'ERR_UNHANDLED_REJECTION'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Versions

package version
@angular-eslint/builder 14.0.4
ESLint 8.23.0
node 16.13.2
# Please run `npx ng version` in your project and paste the full output here:

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 14.2.1
Node: 16.13.2
Package Manager: yarn 1.22.18 
OS: darwin arm64

Angular: 14.2.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... google-maps, language-service, material, platform-browser
... platform-browser-dynamic, platform-server, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1402.1
@angular-devkit/build-angular   14.2.1
@angular-devkit/core            14.2.1
@angular-devkit/schematics      14.2.1
@angular/cli                    14.2.1
@nguniversal/builders           14.2.0
@nguniversal/express-engine     14.2.0
@schematics/angular             14.2.1
rxjs                            7.5.6
typescript                      4.8.3
webpack                         5.74.0
  • I have updated to the latest supported version of the packages and checked my ng version output per the instructions given here.

@ghost ghost added package: builder Angular CLI builder which enables executing ESLint in Angular CLI workspaces triage This issue needs to be looked at and categorized by a maintainer labels Sep 15, 2022
@ghost
Copy link
Author

ghost commented Sep 15, 2022

Downgrading "@angular-eslint/builder" to version 14.0.0 solves the issue

@elcreator
Copy link

#1122 (comment) this may help

@Sebastian-G
Copy link

Sebastian-G commented Sep 21, 2022

Same Issue for Angular 14.2.2

`npx ng version`

Angular CLI: 14.2.3
Node: 16.15.1
Package Manager: npm 8.11.0 
OS: darwin x64

Angular: 14.2.2
... animations, cdk, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1402.3
@angular-devkit/build-angular   14.2.3
@angular-devkit/core            14.2.3
@angular-devkit/schematics      14.2.3
@angular/cli                    14.2.3
@angular/flex-layout            14.0.0-beta.40
@schematics/angular             14.2.3
rxjs                            7.5.6
typescript                      4.7.4

Was working with Angular 14.1.2 + @angular-eslint/builder@14.0.2

Now im not able to run ng lint anymore.

@luca-sharryland temporal fix is working

Downgrading "@angular-eslint/builder" to version 14.0.0 solves the issue

Additional info:

message: 'ValueExpected in /Users/xxx/Documents/Projects/MY-XXXXXXX/tsconfig.json at position 617\n' +
    '\n' +
    'Because of the error the Nx daemon process has exited. The next Nx command is going to restart the daemon process.\n' +
    'If the error persists, please run "nx reset".'

@JamesHenry
Copy link
Member

JamesHenry commented Sep 21, 2022

Thank you for that follow up @elcreator that, plus @Sebastian-G's post, was the key to me being able to reproduce this and then figure it out.

It happens because the Nx daemon eagerly starts after install to help analyze workspaces super fast. However, in this case, I only needed to include the nx core package because of my desire to make my life easier (as a single maintainer) to share the bulk of the implementation of the builder with the Nx executor (which I also created).

This was hugely beneficial earlier on when the implementation was frequently changing, but now that things have stabilised, it's a net win if I remove nx core from the equation and you will no longer see errors like this. I have done that in #1142

This is obviously not a primary use case for Nx core, which is why there are rough edges. To be clear, there are no issues with using angular-eslint with Nx, it's just that I was using nx inside of angular-eslint at runtime to make my life easier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: builder Angular CLI builder which enables executing ESLint in Angular CLI workspaces triage This issue needs to be looked at and categorized by a maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants