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

Failed to process project graph with @nx/js/typescript and no lockfile #29429

Open
1 of 4 tasks
adgoudz opened this issue Dec 19, 2024 · 0 comments
Open
1 of 4 tasks

Failed to process project graph with @nx/js/typescript and no lockfile #29429

adgoudz opened this issue Dec 19, 2024 · 0 comments

Comments

@adgoudz
Copy link

adgoudz commented Dec 19, 2024

Current Behavior

nx graph outputs an error for each tsconfig file in agdz/sample-workspace:

 NX   Failed to create nodes

An error occurred while processing files for the @nx/js/typescript plugin.
  - packages/foo/tsconfig.json: Failed to convert JavaScript value `Null` into rust type `String`
    Error: Failed to convert JavaScript value `Null` into rust type `String`
        at hashArray (/path/to/sample-workspace/node_modules/nx/src/hasher/file-hasher.js:9:12)
        at createNodesInternal (/path/to/sample-workspace/node_modules/@nx/js/src/plugins/typescript/plugin.js:97:50)
        at /path/to/sample-workspace/node_modules/@nx/js/src/plugins/typescript/plugin.js:41:95
        at /path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/utils.js:10:33
        at Array.map (<anonymous>)
        at createNodesFromFiles (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/utils.js:8:35)
        at exports.createNodesV2 (/path/to/sample-workspace/node_modules/@nx/js/src/plugins/typescript/plugin.js:41:60)
        at LoadedNxPlugin.createNodes (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/internal-api.js:34:65)
        at LoadedNxPlugin.createNodes.<computed> (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/internal-api.js:44:34)
  - ...

Other commands fail with:

 NX   Failed to process project graph. Run "nx reset" to fix this. Please report the issue

Expected Behavior

Nx should be able to process the project graph when a project doesn't create a lockfile (package-lock.json in my example).

GitHub Repo

https://github.com/adgoudz/sample-workspace

Steps to Reproduce

  1. npx nx graph

Nx Report

NX   Report complete - copy this into the issue template

Node           : 20.5.1
OS             : darwin-arm64
Native Target  : aarch64-macos
npm            : 10.9.2

nx (global)    : 20.2.2
nx             : 20.2.2
@nx/js         : 20.2.2
@nx/workspace  : 20.2.2
@nx/devkit     : 20.2.2
typescript     : 5.6.3
---------------------------------------
Registered Plugins:
@nx/js/typescript
---------------------------------------
⚠️ Unable to construct project graph.
Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
Failed to process project graph. Run "nx reset" to fix this. Please report the issue if you keep seeing it.
      An error occurred while processing files for the @nx/js/typescript plugin.
    - packages/bar/tsconfig.json: Failed to convert JavaScript value `Null` into rust type `String`
      Error: Failed to convert JavaScript value `Null` into rust type `String`
          at hashArray (/path/to/sample-workspace/node_modules/nx/src/hasher/file-hasher.js:9:12)
          at createNodesInternal (/path/to/sample-workspace/node_modules/@nx/js/src/plugins/typescript/plugin.js:97:50)
          at /path/to/sample-workspace/node_modules/@nx/js/src/plugins/typescript/plugin.js:41:95
          at /path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/utils.js:10:33
          at Array.map (<anonymous>)
          at createNodesFromFiles (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/utils.js:8:35)
          at exports.createNodesV2 (/path/to/sample-workspace/node_modules/@nx/js/src/plugins/typescript/plugin.js:41:60)
          at LoadedNxPlugin.createNodes (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/internal-api.js:34:65)
          at LoadedNxPlugin.createNodes.<computed> (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/internal-api.js:44:34)
          at createNodes (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/isolation/plugin-worker.js:71:63)
    - packages/bar/tsconfig.lib.json: Failed to convert JavaScript value `Null` into rust type `String`
      Error: Failed to convert JavaScript value `Null` into rust type `String`
          at hashArray (/path/to/sample-workspace/node_modules/nx/src/hasher/file-hasher.js:9:12)
          at createNodesInternal (/path/to/sample-workspace/node_modules/@nx/js/src/plugins/typescript/plugin.js:97:50)
          at /path/to/sample-workspace/node_modules/@nx/js/src/plugins/typescript/plugin.js:41:95
          at /path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/utils.js:10:33
          at Array.map (<anonymous>)
          at createNodesFromFiles (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/utils.js:8:35)
          at exports.createNodesV2 (/path/to/sample-workspace/node_modules/@nx/js/src/plugins/typescript/plugin.js:41:60)
          at LoadedNxPlugin.createNodes (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/internal-api.js:34:65)
          at LoadedNxPlugin.createNodes.<computed> (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/internal-api.js:44:34)
          at createNodes (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/isolation/plugin-worker.js:71:63)
    - packages/foo/tsconfig.json: Failed to convert JavaScript value `Null` into rust type `String`
      Error: Failed to convert JavaScript value `Null` into rust type `String`
          at hashArray (/path/to/sample-workspace/node_modules/nx/src/hasher/file-hasher.js:9:12)
          at createNodesInternal (/path/to/sample-workspace/node_modules/@nx/js/src/plugins/typescript/plugin.js:97:50)
          at /path/to/sample-workspace/node_modules/@nx/js/src/plugins/typescript/plugin.js:41:95
          at /path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/utils.js:10:33
          at Array.map (<anonymous>)
          at createNodesFromFiles (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/utils.js:8:35)
          at exports.createNodesV2 (/path/to/sample-workspace/node_modules/@nx/js/src/plugins/typescript/plugin.js:41:60)
          at LoadedNxPlugin.createNodes (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/internal-api.js:34:65)
          at LoadedNxPlugin.createNodes.<computed> (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/internal-api.js:44:34)
          at createNodes (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/isolation/plugin-worker.js:71:63)
    - packages/foo/tsconfig.lib.json: Failed to convert JavaScript value `Null` into rust type `String`
      Error: Failed to convert JavaScript value `Null` into rust type `String`
          at hashArray (/path/to/sample-workspace/node_modules/nx/src/hasher/file-hasher.js:9:12)
          at createNodesInternal (/path/to/sample-workspace/node_modules/@nx/js/src/plugins/typescript/plugin.js:97:50)
          at /path/to/sample-workspace/node_modules/@nx/js/src/plugins/typescript/plugin.js:41:95
          at /path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/utils.js:10:33
          at Array.map (<anonymous>)
          at createNodesFromFiles (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/utils.js:8:35)
          at exports.createNodesV2 (/path/to/sample-workspace/node_modules/@nx/js/src/plugins/typescript/plugin.js:41:60)
          at LoadedNxPlugin.createNodes (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/internal-api.js:34:65)
          at LoadedNxPlugin.createNodes.<computed> (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/internal-api.js:44:34)
          at createNodes (/path/to/sample-workspace/node_modules/nx/src/project-graph/plugins/isolation/plugin-worker.js:71:63)

Failure Logs

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

The error messages refer to the null value created when hashing this path:

https://github.com/nrwl/nx/blob/master/packages/js/src/plugins/typescript/plugin.ts#L219

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant