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 (in promise) TypeError: Cannot read properties of undefined (reading 'trackUbosInFrame') #24

Open
Klee319 opened this issue Nov 14, 2023 · 4 comments

Comments

@Klee319
Copy link

Klee319 commented Nov 14, 2023

I am very interested in this library. While other web viewers had outdated support versions, this one seemed to support even the latest versions (as the commits are recent). However, I am facing the following error and am in trouble.

image

@me4502
Copy link
Member

me4502 commented Nov 14, 2023

You're going to need to provide significantly more information than this. The version you're using, the schematic file, how you're building the site, the code you're using, etc

Ideally a minimal reproduction. As-is there's nothing that can be done based on your report.

@Klee319
Copy link
Author

Klee319 commented Nov 14, 2023

OK. Thank you for your reply.
This is my environment of development
Base language: Ruby 3.1.2
Framework: rails 7.0.5
ViwerVersion:4.8.1
minecraft jar file:1.20.2
I use webpack.

html.erb
<javascript_pack_tag "SchematicViwer"> <canvas id="schematicRenderer" , width="500," height="500"></canvas>
SchematicViwer.js
import {renderSchematic} from "@enginehub/schematicwebviwer" renderSchematic(document.querySelector('#schematicRenderer'), "./sample.schem", { size: 500, renderArrow: false, renderBars: false, corsBypassUrl: 'client.jar', });

@neunapp
Copy link

neunapp commented Apr 5, 2024

Hello, I had this error, I solved it.
This error happens because the html block where it is going to be drawn has not yet been loaded, but the scene is waiting to be created.
What I did was isolate everything into a function that will create the scene after all the html is loaded.

@Klee319
Copy link
Author

Klee319 commented Apr 6, 2024

@neunapp Thank you for your comment!
I'll try it right away!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants