enspiral-cherubi / three-stl-loader

@aleeper's THREE.STLLoader repackaged as a node module
https://www.npmjs.com/package/three-stl-loader
MIT License
13 stars 13 forks source link

Vue - Uncaught RangeError: Offset is outside the bounds of the DataView #8

Open cheriejw opened 6 years ago

cheriejw commented 6 years ago

Using this package with Vue.js

Error in Inspector

I have run THREE alone successfully, just added this portion to the script and there was no visual change from everything that was loading fine, the error message in inspector is above:

    var loader = new STLLoader();
    loader.load('../test-assets/lowerBody.stl', function (geometry) {
      var material = new THREE.MeshNormalMaterial();
      this.mesh = new THREE.Mesh(geometry, material);
      this.scene.add(mesh);
    })
Tu-Szu-Chi commented 6 years ago

I have same issue too. (In React project v.16.4.0)

araker commented 6 years ago

I encoutered this error on node.js, in my case the cause was how the stl was loaded. I was using fs.readFileSync, which reuses the buffer to read in the file (see https://github.com/nodejs/node/issues/11132). Using fs.readFile fixed the issue for me.

mengyliu commented 5 years ago

Same issue here with Reach v.16.7.0

jhimy-michel commented 5 years ago

Any update about this issue?

damienallen commented 5 years ago

I ran into this issue with electron due to overzealous middleware and lacking warnings in both this and the electron-compile library. See my response here for some debugging tips:

https://github.com/enspiral-cherubi/three-stl-loader/issues/10#issuecomment-507184045