Skip to content

Commit

Permalink
fix(js): use absolute filetorun path (#30091)
Browse files Browse the repository at this point in the history
Fix a bug introduced in #30087

#### Current Behavior
The `@nx/js` plugins throw an error when the project is served in the
project root but not in the workspace root.

#### Expected Behavior
Ensure that `nx run $project:serve` works correctly both in the
workspace root and the project root, restoring the previous behavior.

#### Related Issue(s)
Fixes #30087
  • Loading branch information
MisterPandaPooh authored Feb 25, 2025
1 parent 2fc1945 commit 4fc52cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/js/src/executors/node/node.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ function getFileToRun(
const outputFilePath = interpolate(outputPath, {
projectName: project.name,
projectRoot: project.data.root,
workspaceRoot: '',
workspaceRoot: context.root,
});
return path.join(outputFilePath, 'main.js');
}
Expand Down

0 comments on commit 4fc52cf

Please sign in to comment.