From 4fc52cf836deee3991138610764c9b95dce8e3fe Mon Sep 17 00:00:00 2001 From: MisterPandaPooh Date: Tue, 25 Feb 2025 13:44:51 +0200 Subject: [PATCH] fix(js): use absolute filetorun path (#30091) 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 --- packages/js/src/executors/node/node.impl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/js/src/executors/node/node.impl.ts b/packages/js/src/executors/node/node.impl.ts index d31cbeb0ec..8e8a11d654 100644 --- a/packages/js/src/executors/node/node.impl.ts +++ b/packages/js/src/executors/node/node.impl.ts @@ -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'); }