Hi, trying to debug my setup here after failing to get needle to run a server from the editor.
I had it working before with 2021 LTS , but not sure thats the issue.
Node version is v16.17.1
npm is 8.15.0
I am following Option 3 from the getting started guide (btw there it says 'we support 2020.3 and 2022 '- not ‘Unity 2020.3.16+, 2021.3+ or 2022.2+’ )
After creating a new project from Unity Hub, the 3D Core template, and opening it, I add the registry to Package manager and install the Needle Engine Exporter.
I don’t create a new scene from the templates at this point but skip to the Create a new scene from Scratch guide needle-engine-support/documentation/getting-started.md at main · needle-tools/needle-engine-support · GitHub , since I am already in a new project that Unity Hub just created. Then I add a new empty game object and add the Export Info component to it. I click Generate and then node.js opens in a window and reports this error
failed to load config from G:\UnityStuff\needletools\WillItWork\Projects\SampleScene\vite.config.js error when starting dev server: Error [ERR_REQUIRE_ESM]: require() of ES Module G:\UnityStuff\needletools\WillItWork\Projects\SampleScene\node_modules\vite-plugin-compression\dist\index.mjs not supported. Instead change the require of G:\UnityStuff\needletools\WillItWork\Projects\SampleScene\node_modules\vite-plugin-compression\dist\index.mjs to a dynamic import() which is available in all CommonJS modules. at Object.<anonymous> (G:\UnityStuff\needletools\WillItWork\Projects\SampleScene\vite.config.js:34:46) at Object._require.extensions.<computed> [as .js] (file:///G:/UnityStuff/needletools/WillItWork/Projects/SampleScene/node_modules/vite/dist/node/chunks/dep-49b3b5ea.js:63524:24) at loadConfigFromBundledFile (file:///G:/UnityStuff/needletools/WillItWork/Projects/SampleScene/node_modules/vite/dist/node/chunks/dep-49b3b5ea.js:63532:21) at loadConfigFromFile (file:///G:/UnityStuff/needletools/WillItWork/Projects/SampleScene/node_modules/vite/dist/node/chunks/dep-49b3b5ea.js:63400:34) at async resolveConfig (file:///G:/UnityStuff/needletools/WillItWork/Projects/SampleScene/node_modules/vite/dist/node/chunks/dep-49b3b5ea.js:63017:28) at async createServer (file:///G:/UnityStuff/needletools/WillItWork/Projects/SampleScene/node_modules/vite/dist/node/chunks/dep-49b3b5ea.js:62083:20) at async CAC.<anonymous> (file:///G:/UnityStuff/needletools/WillItWork/Projects/SampleScene/node_modules/vite/dist/node/cli.js:700:24)
I guess the first time it worked was because i cloned the repo and just ran the project from Unity Hub (upgraded the project and was fine). But doing this from scratch route and through packagemanager we might have this little problem you fixed
Its because the project in the sample repo was created with Vite 2 and since a few versions we upgraded vite to version 3 but seems I didnt test that well enough/was fooled by some caching there too