google / google/draco

Unable to run the example application

Open
#737 4 comments 4 reactions 1 assignee Claimed by @FrankGalligan View on GitHub
bug
Dominant language
C++
Stars
7.5k
Forks
1.1k
Avg merge
47m
Merged PRs (30d)
1

Description

I followed the steps in https://github.com/google/draco/tree/master/javascript/example and the one in the codelabs https://codelabs.developers.google.com/codelabs/draco-3d/index.html#5 but both of them result in the same error.

```
DRACOLoader.js:7 Uncaught TypeError: Class constructor ic cannot be invoked without 'new'
at new THREE.DRACOLoader (DRACOLoader.js:7)
at webgl_loader_draco.html:47
THREE.DRACOLoader @ DRACOLoader.js:7
(anonymous) @ webgl_loader_draco.html:47
```

In `DRACOLoader.js`

```
/**
* @author Don McCurdy / https://www.donmccurdy.com
*/

THREE.DRACOLoader = function ( manager ) {

THREE.Loader.call( this, manager ); // <--- this line fails with the error "Uncaught TypeError: Class constructor ic cannot be invoked without 'new'"

this.decoderPath = '';
this.decoderConfig = {};
this.decoderBinary = null;
this.decoderPending = null;

this.workerLimit = 4;
this.workerPool = [];
this.workerNextTaskID = 1;
this.workerSourceURL = '';

this.defaultAttributeIDs = {
position: 'POSITION',
normal: 'NORMAL',
color: 'COLOR',
uv: 'TEX_COORD'
};
this.defaultAttributeTypes = {
position: 'Float32Array',
normal: 'Float32Array',
color: 'Float32Array',
uv: 'Float32Array'
};

};
```

Is anyone able to run the example applications within this repository?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.