RangeError: Maximum call stack size exceeded when exporting to gilt file using GLTFExporter
Open
Nobody has claimed this yet.
bug
- Dominant language
- JavaScript
- Stars
- 858
- Forks
- 144
- PR merge metrics
- No merged PRs in 30d
Description
@react-three/dreiversion: ^10.0.4@react-three/fiberversion: ^9.1.0three-stdlibversion: 2.35.14
Problem description:
I get an error when exporting to a gltf file using the following function.
- Components used:
GLTFExporter - Functions used:
parse
Relevant code:
sample:
https://github.com/activeguild/gltfexporter-bug
npm install
npm run dev`
Download GLTFbutton clicked
Suggested solution:
before
async function readAsDataURL(blob) {
const buffer = await blob.arrayBuffer();
const data = btoa(String.fromCharCode(...new Uint8Array(buffer)));
return `data:${blob.type || ""};base64,${data}`;
}
after
async function readAsDataURL(blob) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onloadend = () => resolve(reader.result);
reader.onerror = reject;
reader.readAsDataURL(blob);
});
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked reproducer, run npm install and npm run dev, then click the Download GLTF button to reproduce the RangeError. Trace GLTFExporter.parse through readAsDataURL and compare the provided implementation with the FileReader version. Done means exporting no longer exceeds the call stack and produces a GLTF file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react, three.js
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100