Skip to content

TypeError this.async() is not a function is being throw when new GLTFLoader2() called #1

Description

@johnmc5810

I use:
import GLTFLoader2 from 'gltf-loader-2';
then i call
loadGltfFile(gltfFile) {
const gltfLoader = new GLTFLoader2();
return new Promise(function(resolve, reject) {
gltfLoader.load(
gltfFile,
gltf => resolve(gltf),
onProgress,
err => reject(err),
);
});
}

webpack.config
{
test: /.(gltf)$/,
use: [
/* config.module.rule('gltf').use('gltf-loader-2') /
{
loader: 'gltf-loader-2'
}
]
},
/
config.module.rule('gltf2') /
{
test: /gltf.
.(bin|png|jpe?g|gif)$/,
use: [
/* config.module.rule('gltf2').use('file-loader') */
{
loader: 'file-loader',
options: {
name: 'gltf/[name].[hash:7].[ext]'
}
}
]
}

The gltf file is imported by
import ltHead from '../../assets/gltf/lieutenantHead/lieutenantHead.gltf';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions