jeromeetienne / AR.js

Efficient Augmented Reality for the Web - 60fps on mobile!
MIT License
15.79k stars 2.22k forks source link

CORS Issue in While using in Location Feature #714

Closed mr-talukdar closed 4 years ago

mr-talukdar commented 4 years ago

For some reasons my model isn't loading up as it should at the given coordinates instead it just is stuck in the screen while nothing happens, tried with the default pokemon model of magnemite as described in,

https://medium.com/chialab-open-source/build-your-location-based-augmented-reality-web-app-c2442e716564.

Went on inspecting the Console and found this error.

(index):1 Access to XMLHttpRequest at 'https://raw.githack.com/jeromeetienne/ar.js/master/data/data/camera_para.dat' from origin 'https://snapdragon-boron-u86oljg3n5.glitch.me' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Here's my code, <!DOCTYPE` html>

GeoAR.js demo
nicolocarpignoli commented 4 years ago

That CORS error should not be the cause. Try to deploy it on a github pages instead of Glitch that can give problems and let me know

mr-talukdar commented 4 years ago

GitHub pages give out the same problem. I also tried by hosting it to Firebase it's the same everywhere.

nicolocarpignoli commented 4 years ago

try removing

<script> THREEx.ArToolkitContext.baseURL = 'https://raw.githack.com/jeromeetienne/ar.js/master/three.js/' </script>