When running my Angular Nx project in the VSCode debugger, I encounter an issue with using yarn
.
yarn start
successfully executes the nx serve
command when run from a terminal.
However, the same yarn start
command fails when executed through VSCode debugger. It used to work perfectly fine before migrating from Angular-client (ng
).
Now, I constantly receive this error message:
* Executing task: yarn run start
yarn run v1.22.19
$ nx serve
/path/to/project/node_modules/nx/bin/nx.js:132
globalThis.GLOBAL_NX_VERSION ??= GLOBAL_NX_VERSION;
^
SyntaxError: Unexpected token ?
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
* The terminal process "/usr/bin/zsh '-c', 'yarn run start'" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
Another issue arises:
During debugging (when it was functioning), the debugger always navigated through the node_modules
code despite being listed in my skipFiles
settings.
Here is my configuration in the launch.json
file:
{
"version": "0.2.0",
"configurations": [
{
// Configuration details here...
}
]
}
And below is my setup in the tasks.json
file:
{
"version": "2.0.0",
"tasks": [
{
// Task details here...
}
]
}