Current Behavior
I'm facing a sudden issue and it's most likely coming from an vitest.config.ts file in my root, which was there for a while as a template.
Running the "test" target now produces
NX Output '{workspaceRoot}/test/{projectRoot}' is invalid. When {projectRoot} is '.', it can only be used at the beginning of the expression.
with the following configuration
"test": {
"cache": false,
"dependsOn": ["build"],
"inputs": ["default", "^default"],
"outputs": ["{workspaceRoot}/test/{projectRoot}"]
},
And the failing project is my workspace, the root project @myworkspace/root.
Now the dilemma:
- I can't remove
{workspaceRoot} from the test output config, as it is mandatory
- I can't remove the name of the root package.json, as it is mandatory
- I don't have a project.json in root
- I don't have a test script in root package.json
- I like to use test target defaults for all my projects, but test target makes no sense for root
So my next idea was to comment out the vitest.config.ts and it made the issue disappear.
Expected Behavior
Not sure if the sheer presence of a vitest.config.ts file in the root should cause an issue that is revealing a dilemma.
GitHub Repo
No response
Steps to Reproduce
I could not reproduce this in a sample project so far, event with the exact same nx.sjon.
Nx Report
Node : 25.8.2
OS : win32-x64
Native Target : x86_64-windows
yarn : 4.15.0
daemon : Available
nx : 22.7.5
@nx/js : 22.7.5
@nx/eslint : 22.7.5
@nx/workspace : 22.7.5
@nx/jest : 22.7.5
@nx/devkit : 22.7.5
@nx/esbuild : 22.7.5
@nx/eslint-plugin : 22.7.5
@nx/nuxt : 22.7.5
@nx/playwright : 22.7.5
@nx/plugin : 22.7.5
@nx/vite : 22.7.5
@nx/vitest : 22.7.5
@nx/vue : 22.7.5
@nx/web : 22.7.5
typescript : 6.0.3
---------------------------------------
Registered Plugins:
@nx/vite/plugin
@nx/eslint/plugin
@nx/playwright/plugin
@nx/jest/plugin
@nx/nuxt/plugin
@nx/vitest
---------------------------------------
Cache Usage: 0.00 B / 95.28 GB
Failure Logs
NX Output '{workspaceRoot}/test/{projectRoot}' is invalid. When {projectRoot} is '.', it can only be used at the beginning of the expression.
Error: Output '{workspaceRoot}/test/{projectRoot}' is invalid. When {projectRoot} is '.', it can only be used at the beginning of the expression.
at interpolate (C:\Users\MyLaptop\Workspace\myworkspace\node_modules\nx\dist\src\tasks-runner\utils.js:266:15)
at getOutputsForTargetAndConfiguration (C:\Users\MyLaptop\Workspace\myworkspace\node_modules\nx\dist\src\tasks-runner\utils.js:221:40)
at getOutputs (C:\Users\MyLaptop\Workspace\myworkspace\node_modules\nx\dist\src\tasks-runner\utils.js:126:12)
at ProcessTasks.createTask (C:\Users\MyLaptop\Workspace\myworkspace\node_modules\nx\dist\src\tasks-runner\create-task-graph.js:207:45)
at ProcessTasks.processTasks (C:\Users\MyLaptop\Workspace\myworkspace\node_modules\nx\dist\src\tasks-runner\create-task-graph.js:37:39)
at createTaskGraph (C:\Users\MyLaptop\Workspace\myworkspace\node_modules\nx\dist\src\tasks-runner\create-task-graph.js:224:21)
at createTaskGraphAndRunValidations (C:\Users\MyLaptop\Workspace\myworkspace\node_modules\nx\dist\src\tasks-runner\run-command.js:265:63)
at ensureWorkspaceIsInSyncAndGetGraphs (C:\Users\MyLaptop\Workspace\myworkspace\node_modules\nx\dist\src\tasks-runner\run-command.js:397:21)
at runCommandForTasks (C:\Users\MyLaptop\Workspace\myworkspace\node_modules\nx\dist\src\tasks-runner\run-command.js:334:47)
at C:\Users\MyLaptop\Workspace\myworkspace\node_modules\nx\dist\src\tasks-runner\run-command.js:301:50
Package Manager Version
Yarn Berry 4.15
Operating System
Additional Information
No response
Current Behavior
I'm facing a sudden issue and it's most likely coming from an vitest.config.ts file in my root, which was there for a while as a template.
Running the "test" target now produces
with the following configuration
And the failing project is my workspace, the root project
@myworkspace/root.Now the dilemma:
{workspaceRoot}from the test output config, as it is mandatorySo my next idea was to comment out the
vitest.config.tsand it made the issue disappear.Expected Behavior
Not sure if the sheer presence of a vitest.config.ts file in the root should cause an issue that is revealing a dilemma.
GitHub Repo
No response
Steps to Reproduce
I could not reproduce this in a sample project so far, event with the exact same nx.sjon.
Nx Report
Failure Logs
Package Manager Version
Yarn Berry 4.15
Operating System
Additional Information
No response