pmndrs / gltfjsx

🎮 Turns GLTFs into JSX components
https://gltf.pmnd.rs
MIT License
4.42k stars 290 forks source link

Named export 'DracoMeshCompression' not found #180

Closed ntegrals closed 1 year ago

ntegrals commented 1 year ago

I'm trying to convert a gltf file, and I'm running into this issue. Any ideas how to fix it?

import { DracoMeshCompression, ALL_EXTENSIONS } from '@gltf-transform/extensions'
         ^^^^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'DracoMeshCompression' not found. The requested module '@gltf-transform/extensions' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@gltf-transform/extensions';
const { DracoMeshCompression, ALL_EXTENSIONS } = pkg;
Steveeeie commented 1 year ago

I ran into the same issue when running the package via npx and ended up having to use an older version as a work around:

npx gltfjsx@5.0.4 scene.gltf --transform --types
ntegrals commented 1 year ago

@Steveeeie Thanks a lot! That worked like a charm.

Still not resolved in the current version, so it's probably best to keep the issue open.

donmccurdy commented 1 year ago