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

fix NaN error #4727

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

fix NaN error #4727

wants to merge 1 commit into from

Conversation

bjarthur
Copy link
Contributor

@bjarthur bjarthur commented Jan 16, 2025

Description

when recording an animation using WGLMakie i sometimes get the following error in the browser console. this PR fixes it. my understanding of this part of the makie codebase is as superficial as it gets. not sure if this breaks anything but it fixes my problem. happy to add a test if desired. have not taken the time to devise a MWE but could if you want.

Uncaught TypeError: n.toArray is not a function
    at as (454d14251abd5406c633fb77841dd6097a73cd86-wglmakie.bundled.js:9759:11)
    at yo.k_ [as setValue] (454d14251abd5406c633fb77841dd6097a73cd86-wglmakie.bundled.js:9979:13)
    at qi.upload (454d14251abd5406c633fb77841dd6097a73cd86-wglmakie.bundled.js:10152:39)
    at Fd (454d14251abd5406c633fb77841dd6097a73cd86-wglmakie.bundled.js:13117:628)
    at Ro.renderBufferDirect (454d14251abd5406c633fb77841dd6097a73cd86-wglmakie.bundled.js:12945:72)
    at tl (454d14251abd5406c633fb77841dd6097a73cd86-wglmakie.bundled.js:13073:450)
    at ks (454d14251abd5406c633fb77841dd6097a73cd86-wglmakie.bundled.js:13069:45)
    at el (454d14251abd5406c633fb77841dd6097a73cd86-wglmakie.bundled.js:13041:228)
    at Ro.render (454d14251abd5406c633fb77841dd6097a73cd86-wglmakie.bundled.js:13010:20)
    at render_scene (454d14251abd5406c633fb77841dd6097a73cd86-wglmakie.bundled.js:22949:18)

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Added an entry in CHANGELOG.md (for new features and breaking changes)
  • Added unit tests for new algorithms, conversion methods, etc.

@SimonDanisch
Copy link
Member

You shouldn't edit the bundle file since that's auto generated from source.
As far as I can tell from a quick look, this part seems to come from threejs source.
I guess you jumped there via the debugger? Any information on what the other variables are and why the nan check is necessary?

@bjarthur
Copy link
Contributor Author

bjarthur commented Jan 16, 2025

i'm wondering whether upgrading three.js would help. the comment at the top of WGLMakie/src/THREE.js says 0.157.0. therein i can search on "function as(" and find it and see that it doesn't have the isNaN term that fixes it for me. but if i go to CDN [EDIT: as described in option 2 here] and download v0.157.0 i can't find this same function. what am i missing? 157 is two years old. they're up to 172 now. happy to try upgrading myself but i need some guidance. thanks!

@bjarthur
Copy link
Contributor Author

alternatively, i could just patch our copy of THREE.js and then re-generate wglmakie.bundled.js

@ffreyer ffreyer mentioned this pull request Feb 10, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Work in progress
Development

Successfully merging this pull request may close these issues.

2 participants