Error building on Mac Silicon Unity 2022.3.9

I get the following error when building with Needle 3.31.0:
`/Needle/Main%202/node_modules/vite/bin/vite.js:7
await import(‘source-map-support’).then((r) => r.default.install())
^^^^^

SyntaxError: Unexpected reserved word
at Loader.moduleStrategy (internal/modules/esm/translators.js:140:18)
at async link (internal/modules/esm/module_job.js:42:21)`

Any ideas on how to fix?

Original Post on Discord

by user 1100349294130765885

Hello there – we have an experimental AI bot :robot: that might be able to help you with your question. Would you like to try this out?

The code doesnt look familiar - which vite version are you using there?

vite 4.1.4

by user 1100349294130765885

Here’s someone else having the same issue using laravel npm run dev not working with vite laravel 9 - Stack Overflow

try updating to 4.3.9 - that’s the current version our templates use

which nodejs version are you using?

Seems my node is defaulting to 12 when I build, did nvm 18 now and it ran. But when I run from Unity its back to node 12

by user 1100349294130765885

can you check the project validation window if it contains a path to the wrong version?

You find it here:

.nvm/versions/node/v20.9.0/bin

by user 1100349294130765885

what’s the output you get with nvm ls in a terminal?

       v16.14.0
        v17.8.0
->     v18.13.0
        v20.9.0
         system
default -> 12 (-> v12.22.7)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v20.9.0) (default)```

*by user 1100349294130765885*

Is it your intention to have node 12 as the default?

Can you change the default to e.g. 18?

What terminal output do you get for `which node` --version

I did change to default to 18 and it works, don’t know why it defaulted to 12 but couldn’t Needle to use nvmrc to set the correct Node version?

by user 1100349294130765885

Good to hear.
I will look into nvmrc to see if thats a possibility