Need some help setting up gltf-transform #623
-
Hello All, I know that this question is probably more about understanding how commonJS vs ES6 modules work but I was hoping to get any help on this that might be possible because I have a feeling that the issue might have something to do with the way gl-matrix is being imported with gltf-transform. I installed the npm package for gltf-transforms core and functions along with the web app that we are building. The app is a web-component that would later be deployed on our client's website so eventually gets bundled into a single file. Now the problem is when I install the packages I get a whole bunch of errors in the watcher script + when trying to build the app. The errors are all related to gl-matrix not being present in the dist for this package and I tried building the package using "yarn run dist" and "npm run dist" but still don't see "gl-matrix" being bundled with the core. The image attached below clearly states that I need to "add an extension to the request" but I am not sure where that would be. Is it within the core.modern.js or would I have to either update my packages or use an older version of gltf-transform? Any help would be much appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 11 replies
-
Hi @tanaydimri, and thanks! It sounds like something is going wrong in how Webpack is resolving these imports. You shouldn't normally need to do anything special to have it bundle up dependencies like Could you share the version number of gltf-transform you've installed, and the webpack configuration file? There were changes in the new gltf-transform v2.2 release that might be related. Or possibly something related to webpack's module resolution configuration, which is documented in https://webpack.js.org/configuration/resolve/. |
Beta Was this translation helpful? Give feedback.
-
I encountered the same issue with |
Beta Was this translation helpful? Give feedback.
Hi @tanaydimri, and thanks!
It sounds like something is going wrong in how Webpack is resolving these imports. You shouldn't normally need to do anything special to have it bundle up dependencies like
gl-matrix/vec3
. What you're describing as far as bundling sounds like what I'd expect should happen.Could you share the version number of gltf-transform you've installed, and the webpack configuration file? There were changes in the new gltf-transform v2.2 release that might be related. Or possibly something related to webpack's module resolution configuration, which is documented in https://webpack.js.org/configuration/resolve/.