-
Notifications
You must be signed in to change notification settings - Fork 9
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
updating to react-scripts 5 leads to TypeError, not able to load "three" classes #61
updating to react-scripts 5 leads to TypeError, not able to load "three" classes #61
Comments
Hi @cc-steina, Thanks for the report. The solution is to add The canvas is also white as you're not rendering anything inside of it. I've opened a PR on your repo which fixes the react-scripts 5 issue as well as adds a Let me know if I can close this issue. |
Thank you so much that fixed it instantly! Keep up the great work! |
No worries! 🙂 |
Sorry about reopening the issue but it seems like the upgrade does break something inside the InstantTracker, or the Camera. When a state value in the function above the declaration of the file containing the Zapworks Components is being changed, which forces a rerender, the camera freezes completely. Is there some advanced logging that can be enabled maybe? The camera freeze doesen't throw any errors on the command line or in the chrome debugger console. The logs on the phones are empty too, no error messages, no warnings. |
Interesting, taking a look now. Here's how to set the log level: |
From the logs, looks to me like the camera is being re-rendered, causing things to freeze. Memo'ing it should take care of that: test url: https://nyan-left.github.io/react-three-fiber-react-scripts-broken/ |
Awesome that did the trick and it also fixed another issue that we had: The object scaling larger and smaller based on how close or far you try to get to it, I guess it was also connected to this. It probably updates every other time if the Camera is not Memo'd and because of that recalculating positions and/or scaling. Now it is tracking steady as a rock on the same underground! Thank you so much for your help! |
Great! Best of luck with the project 🙂 |
Describe the bug
Updating react-scripts to Version 5 leads to problems while rendering or even loading in "three" inside lib/cameraTexture.js.
The error "Uncaught TypeError: Class extends value undefined is not a constructor or null" appears in the chrome debug console pointing to line 9 and will cause the whole screen to be white.
Using this setup with react-scripts 4 works without a problem but fails on version 5.
I have created a test repository to give you a better overview here: https://github.com/cc-steina/react-three-fiber-react-scripts-broken as you can see in the actions the build also works fine, it is just a problem when viewing it in the browser.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The Canvas should not cause a white screen when trying to render it.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: