Closed James-Coates closed 5 months ago
That's weird. Can you search for ??=
in your workspace? Maybe the symbol was written into some configuration file that Nx Console is trying to parse and failing?
Be sure to check project.json
, nx.json
and package.json
files too.
Thanks for the response. This was one of the first things I tried and have just tried again for sanity sake but there are no such references to ??=
.
As mentioned this happens for me on a fresh repo using npx create-nx-workspace@latest
Hey! Just ran into this in another setting. Two questions:
Hi Max, using: Node: v18.12.1 and nvm to manage node versions
Just tried LTS (v20.11.0) and still same issue
can you toggle the 'Show Node Version On Startup' setting in Nx Console and confirm that the version used by vscode is the same as you see in your terminal?
Done this and can confirm the version used is the same used as terminal.
Hi, I had the same issue on my macOS and I was able to fix it.
Nx plugin reported version 18.19.1
in 'Show Node Version On Startup'.
But the generator was using some old version on my system and it was failing on Unexpected token '??='
By running /bin/zsh -l -c 'node --version'
and /bin/zsh -l -c 'which node'
I was able to find that I had some Node.js v14 on my system.
When I remove the Node v14 it started to work again.
But I think it is not fixing the core of the issue.
I'm using FNM to manage Node.js versions.
The version reported by 'Show Node Version On Startup' (18.19.1
) is correct version (I have it in .nvmrc
file in root of the project).
But when I run /bin/zsh -l -c 'node --version'
it says v21.6.1
(which is a version of Node.js installed by Homebrew).
It seems that running /bin/zsh -l -c 'node --version'
ignores the ~/.zshrc
file and therefore it does not setup FNM.
Only when I run /bin/zsh -l -i -c 'node --version'
(with -i
for --interactive
) it runs ~/.zshrc
and selects at least default version provide by FNM.
Thanks all, I have managed to resolve the issue my end by updating the node version on my mac's homebrew to lts
Current Behavior
All generators fail when run through NX console on VSCode with the same error. They run fine directly in terminal.
Expected Behavior
Generators to run on NX Console as they do direct in terminal. This is a regression; used to run on my configuration pre upgrade to v17.
Steps to Reproduce
Fresh nx install and commands do not run.
Failure Logs / Images / Videos
The error for all NC Console commands is the same:
Unexpected token '??='
The terminal process "/bin/zsh '-l', '-c', 'npx nx generate @nx/angular:component --name=test --nameAndDirectoryFormat=as-provided --no-interactive --dry-run'" failed to launch (exit code: 1).
Terminal will be reused by tasks, press any key to close it.
Executing task: npx nx run test:build
Unexpected token '??='
Environment