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.

TypeError when calling toObservable in convert-nx-executor.ts

See original GitHub issue

Current Behavior

Running ng lint causes an error in the devkit package of nx.

Expected Behavior

No error to be thrown

The issue is at https://github.com/nrwl/nx/blob/master/packages/devkit/src/utils/convert-nx-executor.ts#L52

if ((!value as any).next) { should be if (!(value as any).next) { (note the placement of the exclamation mark).

Steps to Reproduce

I’m not sure this requires steps to reproduce. The code cannot work since any value, whether it had a next attribute or not, would fail to satisfy the condition and any value that should have passed the condition would cause the error on line 60

I think it would be ideal to have a unit test for this toObservable to avoid this type of issue.

Failure Logs

.../node_modules/@nrwl/devkit/src/utils/convert-nx-executor.js:55
                        .next()
                         ^

TypeError: iterator.next is not a function
    at recurse (/Users/dave/dev/kahi/web-client-app/node_modules/@nrwl/devkit/src/utils/convert-nx-executor.js:55:26)
    at /Users/dave/dev/kahi/web-client-app/node_modules/@nrwl/devkit/src/utils/convert-nx-executor.js:72:17

Environment

NX Report complete - copy this into the issue template

Node : 16.15.1 OS : darwin arm64 npm : 6.14.15

nx : 14.5.8 @nrwl/angular : Not Found @nrwl/cypress : Not Found @nrwl/detox : Not Found @nrwl/devkit : 14.5.8 @nrwl/eslint-plugin-nx : Not Found @nrwl/express : Not Found @nrwl/jest : Not Found @nrwl/js : Not Found @nrwl/linter : Not Found @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : Not Found @nrwl/nx-cloud : Not Found @nrwl/nx-plugin : Not Found @nrwl/react : Not Found @nrwl/react-native : Not Found @nrwl/schematics : Not Found @nrwl/storybook : Not Found @nrwl/web : Not Found @nrwl/workspace : Not Found typescript : 4.6.4

Local workspace plugins:

Community plugins: rxjs: 6.5.5 @cypress/schematic: 2.0.2

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:13
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Max-LABcommented, Sep 7, 2022

Had the same issue, fixed it by updating those devDependencies to a version 14.0.3 in my package.json file

"devDependencies": {
    "@angular-eslint/builder": "14.0.3",
    "@angular-eslint/eslint-plugin": "14.0.3",
    "@angular-eslint/eslint-plugin-template": "14.0.3",
    "@angular-eslint/schematics": "14.0.3",
    "@angular-eslint/template-parser": "14.0.3",

Also, we can find info about @nrwl/devkit updates in angular-eslint changelog CHANGELOG.md

1reaction
AgentEndercommented, Aug 23, 2022

The only affected package version with this should be 14.5.8, since 14.5.9 has been released nx migrate 14.5.9 is the recommended remediation for the bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Errors running ng lint on newly created Angular workspace
This is a bug in @nrwl/devkit package that the @angular-eslint/builder depends on. It has been reported in their GitHub repo here.
Read more >
Converting a Promise into an Observable - DEV Community ‍ ‍
We're still missing one crucial part in our Promise to Observable conversion. In our case, the promise was representing an HTTP call.
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