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
Bug with loading of <a-assets> #5251
Comments
How is local different than glitch? Are you serving your image through a web server? Perhaps relevant: https://aframe.io/docs/1.4.0/introduction/faq.html#why-does-my-asset-e-g-image-video-model-not-load |
It is a matter of network speed and timing, that's why my glitch example was not working, sorry. If the image is small enough/ network fast enough, the image is loaded before we wait on the onload event and therefore causing the issue. I could reproduce it with the following glitch example: https://glitch.com/edit/#!/erratic-like-ocean?path=index.html%3A11%3A19 It does not happen always but sometimes does (in particular when cache is cleared), as it is a matter of timing. Can you reproduce? |
Couldn't reproduce with a fiddle, now i see why :D |
Can you try with a master build? https://cdn.jsdelivr.net/gh/aframevr/aframe@3d281849d480293d10badca644584806c3f4906a/dist/aframe-master.min.js |
Same, ctrl-F5 (on chrome even the first load) results in a blue screen until |
I tried with the master build, same problem. The thing that fixes it is if we check if the loading of the image is already complete with something like below. if (imgEl.complete) {
resolve();
} Here's a glitch with the master: https://glitch.com/edit/#!/familiar-obtainable-agenda?path=index.html%3A20%3A0 |
Thanks! Yeah we can add such line:
PR welcome. |
Alright, will create a PR |
@tomfelder94 thanks so much! |
Created the PR: #5253 Wasn't sure if I was supposed to commit the dist files... |
Fixed by #5251 |
Description:
We found a bug in which the loading of images is not correctly handled. Because of this, the loading screen is always waiting until the timeout is fired. I attached a very simple code below, you just need to add a random image ("image.jpg") to reproduce (not reproducible on glitch, image needs to be local).
The issue seems to be in the following part of the a-assets code:
line 47 and following:
We are not handling the case if the image has already been loaded, in this case promise is never being resolved. We should use something like the following in the promise:
Is this a known issue or are we missing something? I could create a PR for that if you wish.
The text was updated successfully, but these errors were encountered: