Forked repo cannot work due to missing lib folder and missing assets
As per subject.
make sure to run npm run build
your build directory should look like this (notice lib folder should exists):
For the assets you will need to download it separately, see README https://github.com/mkkellogg/GaussianSplats3D?tab=readme-ov-file#building-from-source-and-running-locally
I manage to reproduce the missing lib issue after taking a closer look.
Since [email protected] they extracted some of the exports from three.module.js into three.core.js
If our package manager installed the newer version of threejs, we will get an error message saying three.core.js is missing
Reference:
- https://app.unpkg.com/[email protected]/files/build/three.module.js (three.core.js is imported here)
- https://app.unpkg.com/[email protected]/files/build/three.module.js
--
As a temporary workaround:
- Option 1: use threejs 0.160.0 - 0.170.0
- in this project threejs should already be pinned to 0.160.0 from the
package-lock.json - I am using
pnpmsopackage-lock.jsongot ignored, maybe try usingnpminstead or pin the version back to 160 from your package manager
- in this project threejs should already be pinned to 0.160.0 from the
- Option 2: copy
three.core.jstobuild/demo/libfromnode_modules/three/build/three.core.js
--
Long term?
Perhaps rollup can be used to bundle the library code from node_modules into the demo app
Option 2 is straightforward for a quick fix. #452 fixes it for old a new three version.
@vincentfretin I went ahead and just added your fix suggestions to the dev branch along with some other changes I have pending there. I'll try to get it into main soon.
I don't use npm and I don't want to install it or to push my users to install it, I only work offline with pure js and locally. So, can I use this repo anyway?
By the way, to avoid issues with Three.js I usually use v.128 ( https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js ) which does not rely on modules but on plain js and still serves OrbitControls in examples folder ( https://cdn.jsdelivr.net/npm/[email protected]/examples/js/controls/OrbitControls.js )
Both of them work fine if downloaded locally and referred in html as simple scripts to load with script tag (no "module" attribute).
@jumpjack You can use importmap with cdn urls and use modules all the way, even OrbitControls on latest threejs, no need to have node and npm installed. This is what I did for this aframe example https://kgaussiansplat.glitch.me, see the source.
Modules do not work from local disk.