Current Behavior
Environment
- Nx version: 22.3.3
- @nx/js version: 22.3.3
- TypeScript version: 5.8.3-5.9.3
- Workspace: npm workspaces with TypeScript project references
- Packages: 11 TypeScript packages (buildable libraries)
Problem
The @nx/js/typescript plugin is not inferring build or typecheck tasks. All tasks continue to use nx:run-script executor (inferred from package.json scripts) instead of nx:run-commands executor with proper caching configuration.
Non-Standard Configuration
Our workspace uses .config/ directory for Nx and TypeScript configs:
.config/nx.json (not ./nx.json)
.config/tsconfig.base.json (not ./tsconfig.base.json)
- Packages extend:
"extends": "../../.config/tsconfig.base.json"
Question: Does the plugin require tsconfig.base.json at workspace root, or should it work with custom config directory structure?
Workaround (Confirms Expected Behavior)
Creating manual project.json with nx:run-commands executor DOES work:
- Caching functions correctly
- Cache-hit/cache-miss behaves as expected
- Proves the issue is plugin inference, not caching mechanism
Expected Behavior
Expected Behavior
Plugin should automatically:
- Detect buildable libraries (exports → dist/)
- Create build/typecheck targets with
nx:run-commands executor
- Configure inputs/outputs for caching
- Register
@nx/js:typescript-sync generator
GitHub Repo
No response
Steps to Reproduce
Evidence
-
Plugin is registered in .config/nx.json:
{
"plugins": [
{
"plugin": "@nx/js/typescript",
"options": {
"typecheck": { "targetName": "check", "configName": "tsconfig.check.json" },
"build": { "targetName": "build", "configName": "tsconfig.json" }
}
}
]
}
-
All packages have required setup:
- ✅
tsconfig.json exists (runtime config)
- ✅
package.json has exports pointing to ./dist/* (buildable)
- ✅
composite: true and declaration: true in base config
- ✅ TypeScript project references configured
-
But targets show wrong executor:
npx nx show project domains --json | jq '.targets.build.executor'
# Returns: "nx:run-script" (should be "nx:run-commands")
-
No sync generator registered:
npx nx sync
# Output: "There are no sync generators to run"
# Expected: @nx/js:typescript-sync should run
-
Test: Removing build script doesn't trigger plugin:
- Removed
"build": "tsc -b" from package.json
- Result: NO build target created at all
- Expected: Plugin should infer build target from tsconfig.json
Nx Report
NX Report complete - copy this into the issue template
Node : 22.18.0
OS : linux-x64
Native Target : x86_64-linux
npm : 10.9.0
nx : 22.3.3
@nx/js : 22.3.3
@nx/workspace : 22.3.3
@nx/devkit : 22.3.3
typescript : 5.9.3
---------------------------------------
Cache Usage: 0.00 B / 95.23 GB
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
Non-Standard Configuration
Our workspace uses .config/ directory for Nx and TypeScript configs:
.config/nx.json (not ./nx.json)
.config/tsconfig.base.json (not ./tsconfig.base.json)
- Packages extend:
"extends": "../../.config/tsconfig.base.json"
Question: Does the plugin require tsconfig.base.json at workspace root, or should it work with custom config directory structure?
Workaround (Confirms Expected Behavior)
Creating manual project.json with nx:run-commands executor DOES work:
- Caching functions correctly
- Cache-hit/cache-miss behaves as expected
- Proves the issue is plugin inference, not caching mechanism
Current Behavior
Environment
Problem
The
@nx/js/typescriptplugin is not inferring build or typecheck tasks. All tasks continue to usenx:run-scriptexecutor (inferred from package.json scripts) instead ofnx:run-commandsexecutor with proper caching configuration.Non-Standard Configuration
Our workspace uses
.config/directory for Nx and TypeScript configs:.config/nx.json(not./nx.json).config/tsconfig.base.json(not./tsconfig.base.json)"extends": "../../.config/tsconfig.base.json"Question: Does the plugin require tsconfig.base.json at workspace root, or should it work with custom config directory structure?
Workaround (Confirms Expected Behavior)
Creating manual
project.jsonwithnx:run-commandsexecutor DOES work:Expected Behavior
Expected Behavior
Plugin should automatically:
nx:run-commandsexecutor@nx/js:typescript-syncgeneratorGitHub Repo
No response
Steps to Reproduce
Evidence
Plugin is registered in
.config/nx.json:{ "plugins": [ { "plugin": "@nx/js/typescript", "options": { "typecheck": { "targetName": "check", "configName": "tsconfig.check.json" }, "build": { "targetName": "build", "configName": "tsconfig.json" } } } ] }All packages have required setup:
tsconfig.jsonexists (runtime config)package.jsonhasexportspointing to./dist/*(buildable)composite: trueanddeclaration: truein base configBut targets show wrong executor:
No sync generator registered:
Test: Removing build script doesn't trigger plugin:
"build": "tsc -b"from package.jsonNx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
Non-Standard Configuration
Our workspace uses
.config/directory for Nx and TypeScript configs:.config/nx.json(not./nx.json).config/tsconfig.base.json(not./tsconfig.base.json)"extends": "../../.config/tsconfig.base.json"Question: Does the plugin require tsconfig.base.json at workspace root, or should it work with custom config directory structure?
Workaround (Confirms Expected Behavior)
Creating manual
project.jsonwithnx:run-commandsexecutor DOES work: