Error in threejs and gltf loader file converted to umd using rollup

I have converted the three.module.js from the built folder to a UMD file using Rollup. But I am getting this weird error when trying to use the threejs file in my vanilla js project -

Uncaught TypeError: Cannot read properties of undefined (reading 'getX')
    at Vector4.fromBufferAttribute (THREE.js:2915:23)
    at SkinnedMesh.applyBoneTransform (THREE.js:32616:15)
    at SkinnedMesh.getVertexPosition (THREE.js:32532:9)
    at SkinnedMesh.computeBoundingSphere (THREE.js:32469:10)
    at Frustum.intersectsObject (THREE.js:13374:50)
    at projectObject (THREE.js:29857:47)
    at projectObject (THREE.js:29915:6)
    at WebGLRenderer.render (THREE.js:29679:5)
    at animate (activity.js:89:13)
    at activity.js:86:3

would you clarify what you mean by “vanilla js project” ? threejs is vanilla js. im guessing you mean your project is based on pre module-era ecmascript 5?

@drcmda , yes it is ecma 5. What I am trying to do is to run GLTF Loader. I have used the same rollup script to convert the GLTF Loader file to a UMD, and I want to do the same for the three.js file in the build folder of the repo.
This is for r166.

@Samarth_Bagga maybe try using Demoduler to see if that might fix the issue.

1 Like

I have managed to fix that issue, but run into another one with the gltf loader file. When I am trying to load the gltf model I get these errors-

An error happened TypeError: Cannot read properties of undefined (reading 'workingColorSpace')
    at addPrimitiveAttributes (gltf.js:4647:30)
    at GLTFParser.loadGeometries (gltf.js:3666:25)
    at GLTFParser.loadMesh (gltf.js:3709:25)
    at gltf.js:2817:35
    at GLTFParser._invokeOne (gltf.js:2758:20)
    at GLTFParser.getDependency (gltf.js:2815:25)
    at GLTFParser.createNodeMesh (gltf.js:4037:18)
    at gltf.js:4153:38
    at GLTFParser._invokeOne (gltf.js:2758:20)
    at GLTFParser._loadNodeShallow (gltf.js:4151:31)

Uncaught (in promise) TypeError: THREE.LoaderUtils.resolveURL is not a function

thank you this worked !