NeedleTools engine package dependency in production

can you somehow verify that the three version is the correct one on gitlab?

I’ve asked to the admin, awaiting a response. It seemed to be a missing dependency to meshoptimizer module.

by user 615280976855171083

Okay, so even in local I have the issue. I’ve tried to build the project without using Unity in another directory and I have the same issues where meshopt_decoder.module.js is missing, and trying to npm start doesn’t work as the package three can’t be read.
What I’ve done to get this issue:

  • git clone the same project in another directory
  • go to the Needle web export project
  • edit the package.json to replace the two file:// dependencies by "@needle-tools/engine": "2.65.2-pre", "@needle-tools/three": "0.146.5"
  • npm install
  • npm start (or) npm run build:production

by user 615280976855171083

I will look into it.

About threejs this is what the dependencies should contain just in case
"three": "npm:@needle-tools/three@^0.146.5",

Oh ! Let’s try this then, that might be the issue.

by user 615280976855171083

Yes maybe

Do you have another entry with a “three” version in the package.json?

We’re also using "@types/three": "0.146.0".

by user 615280976855171083

I believe that’s only for linting / typescript compilation. But the error you’re getting is a import not being able to be resolved

If I wanted to install @needle-tools/three as the package three directly with the npm install command (without editing the package.json file), what should I type exactly for the command ?

by user 615280976855171083

npm install three@npm:@needle-tools/three@^0.146.5

I’m asking because I wonder if the install uses the package-lock with previous installs (which I can’t get rid of because of private packages). After npm install, the package node_modules/three is still a broken symlink, which is weird.

by user 615280976855171083

And thanks ! :+1:

by user 615280976855171083

Maybe --no-package-lock helps?

It worked for the npm start ! :sparkles: However the build still throws this error :
Error: Cannot find module 'C:\(...)\Needle\NeedleWeb\node_modules\@needle-tools\engine\node_modules\@needle-tools\gltf-transform-extensions\pack-gltf.mjs'

by user 615280976855171083

The Unity build? When making a production build?

Nope, when doing npm run build:production. As we want to build it in Gitlab without having to install Unity.

by user 615280976855171083

Then you want to change this command in your package.json "pack-gltf": "npm run pack-gltf --prefix node_modules/@needle-tools/engine"

to node --no-experimental-fetch node_modules/@needle-tools/gltf-transform-extensions/pack-gltf.mjs

and install "@needle-tools/gltf-transform-extensions": "^0.11.2-pre", in your main project as a devDependency
(note that we want to rename that package in a future version to something like build-pipeline)

Alright ! Let’s try this.

by user 615280976855171083

It worked ! :sparkles: I hope it’ll work on the Gitlab server as well.

by user 615280976855171083