Skip to content

Conversation

@alessiopelliccione
Copy link

The node executor now correctly handles TypeScript's rootDir configuration when calculating output file paths.

Current Behavior

A Nx project has a build target using @nx/js:tsc with options:

  • rootDir: "{projectRoot}/src"
  • main: "{projectRoot}/src/main.ts"

Running nx build correctly generates main.js in dist/apps/project_a respecting rootDir.

However, the serve target (@nx/js:node) fails.

Expected Behavior

The serve target runs without errors.

The @nx/js:node executor correctly resolves the built JS file’s path, respecting the rootDir configuration, instead of incorrectly adding src under dist.

Related Issue(s)

Fixes #33577 where rootDir breaks js:node executor.

The node executor now correctly handles TypeScript's rootDir configuration when calculating output
file paths.

closed nrwl#33577
@alessiopelliccione alessiopelliccione requested a review from a team as a code owner November 23, 2025 16:50
@netlify
Copy link

netlify bot commented Nov 23, 2025

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 73405f1

@vercel
Copy link

vercel bot commented Nov 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Nov 23, 2025 4:54pm

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can not serve build because outcome of getFileToRun incorrect for @nx/js:tsc with rootDir set

1 participant