Closed deprecatedcoder closed 6 years ago
i was able to reproduce it:
this happens in the rare case of loading poly model in two tabs from two different domains. (in your case: codepen and glitch.me). i was only able to reproduce it in chrome. it's a CORS issue in the request going from chrome to poly.gogle.com (the pseudo-API server is not involved.) It looks like a bug in CORS implementation either on browser or server side. reloading with cache disabled resolves it. not sure what i could do about this...
i guess it will not affect users because they are mostly not loading poly models from various domains.
and hell yes: keep on breaking things! ;D
Ah, that makes a lot of sense and yeah, doesn't sound like it would be worth pursuing any kind of fix. It was an odd situation to be trying out anyway. Thanks for looking into it. I'll keep pulling threads 👍
This happens for me as well, but with only one domain. You can use my site to test, it works in Firefox but not Chrome:
https://banada.github.io/aframe-object-scaling/
Thanks!
Thx for providing a test-case! I’m currently on the road without laptop but I will be able to have a look on the next weekend. Hope it’s not urgent?
@banada i get a 404 when following the link. Have you been able to resolve the issue in meanwhile? (would love to know how you fixed it)
@tomas-polach sorry the link has moved to https://banada.github.io/webvr/aframe-object-scaling
@banada Your example works really well! I actually too well: I can't reproduce the error :D
Idea: try using the lib with a Poly API Key:
// 1. replace
<script src="https://dist.3d.io/3dio-js/1.x.x/3dio.min.js"></script>
// with
<script src="https://cdn.rawgit.com/archilogic-com/aframe-gblock/6498b71d/dist/gblock.js"></script>
// 2. replace
<a-entity id="model" gblock="https://poly.google.com/view/bf6_h_1wp2D"></a-entity>
// with
<a-entity id="model" gblock="https://poly.google.com/view/bf6_h_1wp2D?key=YOUR_POLY_API_KEYHERE"></a-entity>
I will update the docs accordingly. Using the Poly AKI Key is the recommended way and might also help with CORS issues. Pls let me know if it helps.
@tomas-polach Works just fine now, even without changing anything. CORS issues are the worst >.< Thanks for the help!
@banada I'm really glad to hear that! yeah, CORS ... >.<
I swear I am not trying to break things :-D
When putting together a simple AR viewer for Poly models I ran into the following error when trying to use this model:
It worked for various other ones I tried (as commented out there), so I am not sure if it's just this specific model or not. I suspect it might be with caching on your pseudo-API server? I am pretty sure I tried to pull in that model from the codepen example first, otherwise I don't really have any idea.