Skip to content

In my ts project adding a new js library always creates a duplicate @nx/js/typescript plugin entry #33981

@berenddeboer

Description

@berenddeboer

Current Behavior

Given this nx.json:

  "plugins": [
    {
      "plugin": "@nx/js/typescript",
      "options": {
        "typecheck": {
          "targetName": "typecheck"
        },
        "build": {
          "targetName": "build",
          "configName": "tsconfig.lib.json",
          "buildDepsName": "build-deps",
          "watchDepsName": "watch-deps"
        }
      }
    },

After running npx nx g @nx/js:lib packages/job-handler I end up with:

  "plugins": [
    {
      "plugin": "@nx/js/typescript",
      "options": {
        "typecheck": {
          "targetName": "typecheck"
        },
        "build": {
          "targetName": "build",
          "configName": "tsconfig.lib.json",
          "buildDepsName": "build-deps",
          "watchDepsName": "watch-deps"
        }
      },
      "exclude": ["packages/job-handler/*"]
    },
    {
      "plugin": "@nx/js/typescript",
      "include": ["packages/job-handler/*"],
      "options": {
        "typecheck": {
          "targetName": "typecheck"
        }
      }
    }

This doesn't make any sense to me. Possibly this "build" target override?

Expected Behavior

I expect no duplicate entries ever to be created.

GitHub Repo

No response

Steps to Reproduce

  1. See above.

Nx Report

NX   Report complete - copy this into the issue template

Node           : 24.11.1
OS             : linux-x64
Native Target  : x86_64-linux
bun            : 1.3.4

nx                 : 22.3.3
@nx/js             : 22.3.3
@nx/eslint         : 22.2.0
@nx/devkit         : 22.3.3
@nx/esbuild        : 22.3.3
@nx/eslint-plugin  : 22.2.0
@nx/next           : 22.3.3
@nx/node           : 22.3.3
@nx/playwright     : 22.3.3
@nx/vite           : 22.3.3
@nx/vitest         : 22.3.3
@nx/web            : 22.3.3
typescript         : 5.9.3
---------------------------------------
Registered Plugins:
@nx/js/typescript
@nx/next/plugin
@nx/playwright/plugin
@nx/vite/plugin
@berenddeboer/nx-aws-cdk/plugin
@nx/vitest
@berenddeboer/nx-biome
---------------------------------------
Community plugins:
@berenddeboer/nx-aws-cdk : 3.0.3
@berenddeboer/nx-biome   : 1.0.1
---------------------------------------
Cache Usage: 59.68 MB / 40.39 GB
---------------------------------------
The following packages should match the installed version of nx
  - @nx/eslint@22.2.0
  - @nx/eslint-plugin@22.2.0

To fix this, run `nx migrate nx@22.3.3`
---------------------------------------
⚠️ Multiple Nx versions detected

Your workspace uses nx@22.3.3, but other packages depend on a different version:
  - nx@22.2.3

These packages should not have nx as a dependency. Please report this issue to the package maintainers.
Run `bun why nx@22.2.3` for more details.

Failure Logs

Package Manager Version

Bun 1.3.4

Operating System

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

Additional Information

No response

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions