The use of require and import?

clipboard.png
model.jsindex.jsnpmimport

clipboard.png

Feb.24,2022

seems to be exported in the default way that is not used in the three-gltf-exporter package. Take a look at it and see if it is exported in such a way as export default. If not, then the error is confirmed. You can use import * as GLTFExoprter from 'three-gltf-exporter'. In this way, you won't make a mistake


import/export is the syntax of ES6 loading module, and require/module.exports is the syntax of nodejs loading module
when you use import

import GLTFExoprter from 'three-gltf-exporter';

three-gltf-exporter this file should be written as

export default _GLTFExoprter;

MDN document import

Menu