GaussianSplats3D icon indicating copy to clipboard operation
GaussianSplats3D copied to clipboard

Forked repo cannot work due to missing lib folder and missing assets

Open jumpjack opened this issue 8 months ago • 7 comments

As per subject.

jumpjack avatar Apr 18 '25 06:04 jumpjack

make sure to run npm run build

your build directory should look like this (notice lib folder should exists):

Image

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

amoshydra avatar May 01 '25 04:05 amoshydra

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

Image

Reference:

--

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 pnpm so package-lock.json got ignored, maybe try using npm instead or pin the version back to 160 from your package manager
  • Option 2: copy three.core.js to build/demo/lib from node_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

amoshydra avatar May 01 '25 04:05 amoshydra

Option 2 is straightforward for a quick fix. #452 fixes it for old a new three version.

vincentfretin avatar May 02 '25 07:05 vincentfretin

@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.

mkkellogg avatar May 05 '25 14:05 mkkellogg

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 avatar May 07 '25 06:05 jumpjack

@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.

vincentfretin avatar May 07 '25 07:05 vincentfretin

Modules do not work from local disk.

jumpjack avatar May 07 '25 09:05 jumpjack