question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

STLLoader Giving "errorRangeError: Invalid typed array length: 17576829549" Reading Wrong Number of Faces

See original GitHub issue

I’ve got an STL file with 4811 faces but STLLoader.js is detecting 1818587680 faces. It says 1818587680 faces no matter which STL file I choose.

I see in STLLoader.js, it detects the file is in binary format and it looks at offset 80 here:

  function parseBinary(data) {
      var reader = new DataView(data);
      var faces = reader.getUint32(80, true);

I’m using three and STLLoader in React. I’m importing the modules STLLoader needs using:

import {
  BufferAttribute,
  BufferGeometry,
  FileLoader,
  Float32BufferAttribute,
  Loader,
  LoaderUtils,
  Vector3
} from "three";

I installed three using “yarn add three”

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
AdamMarciniakcommented, Mar 13, 2020

Alright thanks 😃

1reaction
WestLangleycommented, Mar 13, 2020

If you need help, you can try the three.js forum.

Read more comments on GitHub >

github_iconTop Results From Across the Web

STLLoader in Vue not functioning - Stack Overflow
So I am pretty sure this is an issue with my code and not with the THREE and Vue intergration. I am not...
Read more >
RangeError: invalid array length - JavaScript - MDN Web Docs
The JavaScript exception "Invalid array length" occurs when specifying an array length that is either negative, a floating number or exceeds ...
Read more >
STL Loader file path issues - Questions - three.js forum
I have some problems rendering my STL file with the STLLoader from ThreeJS. First, I encountered this error message RangeError: Invalid typed array...
Read more >
WebGL: RangeError: invalid array length - Unity Forum
I'm getting this same error RangeError: Invalid Typed Array Length with a setting of 1024mb....but 1000 works, trying to figure out what the ......
Read more >
App Service deployment results in RangeError: Invalid typed ...
When trying to deploy to App Service from DevOps, I get "RangeError: Invalid typed array length". No information is given as to where...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found