Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read properties of undefined (reading 'triangles') on STLExporter.parse #160

Closed
gabotechs opened this issue Jun 18, 2022 · 1 comment · Fixed by #161
Labels
bug Something isn't working released

Comments

@gabotechs
Copy link
Contributor

  • three version: 0.132.2
  • @types/three version: 0.132.2
  • three-stdlib version: 2.10.2

Problem description:

While calling STLExporter.parse the following uncaught exception is raised:

Uncaught TypeError: Cannot read properties of undefined (reading 'triangles')
    at STLExporter.js:65:1
    at Mesh.traverse (three.module.js:6983:1)
    at STLExporter.parse (STLExporter.js:55:1)
    at Object.save (SceneSetup.tsx:118:1)

Suggested solution:

The callback in https://github.com/pmndrs/three-stdlib/blob/main/src/exporters/STLExporter.ts#L55 should be an arrow function, so that this is correctly binded in https://github.com/pmndrs/three-stdlib/blob/main/src/exporters/STLExporter.ts#L66

@github-actions
Copy link

🎉 This issue has been resolved in version 2.10.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant