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

The "@nx/node:application" generator fails with "--js" flag #30067

Closed
1 of 4 tasks
ChngYrNick opened this issue Feb 17, 2025 · 0 comments · Fixed by #30073
Closed
1 of 4 tasks

The "@nx/node:application" generator fails with "--js" flag #30067

ChngYrNick opened this issue Feb 17, 2025 · 0 comments · Fixed by #30073

Comments

@ChngYrNick
Copy link

ChngYrNick commented Feb 17, 2025

Current Behavior

I created a new Nx monorepo and attempted to generate a new Node.js project using the following command:
ng g @nx/node:application apps/api --js
However, the command failed with the following error message:

json.exclude is not iterable

Expected Behavior

The command should successfully generate a Node.js application using JavaScript without errors, creating the expected project structure and configurations.

GitHub Repo

No response

Steps to Reproduce

Steps to Reproduce

  1. Create a new Nx monorepo:
    npx create-nx-workspace@latest project
  2. Navigate to the project directory:
    cd project
  3. Generate a new Node.js application with JavaScript:
    ng g @nx/node:application --js
  4. Observe the error message:
    json.exclude is not iterable
    

Nx Report

Node           : 20.17.0
OS             : linux-x64
Native Target  : x86_64-linux
npm            : 10.8.2

nx (global)    : 20.4.4
nx             : 20.4.4
@nx/js         : 20.4.4
@nx/jest       : 20.4.4
@nx/eslint     : 20.4.4
@nx/workspace  : 20.4.4
@nx/devkit     : 20.4.4
@nx/node       : 20.4.4
typescript     : 5.7.3

Failure Logs

TypeError: json.exclude is not iterable
    at /home/serhii/projects/salutem/node_modules/@nx/devkit/src/generators/update-ts-configs-to-js.js:31:25
    at updateJson (/home/serhii/projects/salutem/node_modules/nx/src/generators/utils/json.js:46:26)
    at updateTsConfigsToJs (/home/serhii/projects/salutem/node_modules/@nx/devkit/src/generators/update-ts-configs-to-js.js:28:41)
    at applicationGeneratorInternal (/home/serhii/projects/salutem/node_modules/@nx/node/src/generators/application/application.js:420:42)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /home/serhii/projects/salutem/node_modules/nx/src/command-line/generate/generate.js:240:26
    at async handleErrors (/home/serhii/projects/salutem/node_modules/nx/src/utils/handle-errors.js:8:24)
    at async Object.handler (/home/serhii/projects/salutem/node_modules/nx/src/command-line/generate/command-object.js:13:22)

Package Manager Version

10.8.2

Operating System

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

Additional Information

WSL version: 2.4.11.0.
OS: Ubuntu 22.04.5 LTS

@leosvelperez leosvelperez self-assigned this Feb 17, 2025
jaysoo pushed a commit that referenced this issue Feb 18, 2025
…ns when updating tsconfig to support js (#30073)

## Current Behavior

The `updateTsConfigsToJs` helper from `@nx/devkit` doesn't handle
tsconfig files without the `include` or `exclude` properties.

## Expected Behavior

The `updateTsConfigsToJs` helper from `@nx/devkit` should handle
tsconfig files without the `include` or `exclude` properties.

## Related Issue(s)

Fixes #30067
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants