Skip to content

RangeError: Maximum call stack size exceeded when exporting to gilt file using GLTFExporter #414

Open
@activeguild

Description

@activeguild
  • @react-three/drei version: ^10.0.4
  • @react-three/fiber version: ^9.1.0
  • three-stdlib version: 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 GLTF button 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);
  });
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @activeguild

        Issue actions

          RangeError: Maximum call stack size exceeded when exporting to gilt file using GLTFExporter · Issue #414 · pmndrs/three-stdlib