We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

CORS problem when i need to load scene from another domain

Home Forums General Questions CORS problem when i need to load scene from another domain

  • This topic has 4 replies, 2 voices, and was last updated 1 week ago by xeon.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #45357
    core3d
    Customer

    I’m trying to use a loadScene puzzle for calling a gltf model from a database on another domain. But I’m getting a CORS error when I call gltf model. Those two domains are configured to work together already and there is no problem with that.
    Can I add custom headers to loadScenes fetch requests?
    I’m using VueJs by the way.
    My code is:

    sceneURL = initOptions.useCompAssets ? sceneURL + '.xz' : sceneURL; // sceneURL comes from REST api (file contains on another domain (REST API's domain))
                window.vergeApp.loadScene(sceneURL, function() {
                    window.vergeApp.enableControls();
                    window.vergeApp.run();
    
                    if (v3d.PE) v3d.PE.updateAppInstance(window.vergeApp);
                    if (v3d.PL) v3d.PL.init(window.vergeApp, initOptions);
    
                    vue.runCode(window.vergeApp);
    
    #45358
    core3d
    Customer

    Ah, sorry i didn’t see that :
    https://www.soft8soft.com/docs/api/en/loaders/GLTFLoader.html#setCrossOrigin
    I will try this one, i hope i can solve with it.

    #45456
    core3d
    Customer

    Nope, unfortunately not working. CORS is properly configured on server side, everything else is working. Even though i set setCrossOrigin and credentials. Looks like XMLHttpRequest headers can not return with loader and getting “No ‘Access-Control-Allow-Origin’ header is present on the requested resource.” error.

    #46347
    core3d
    Customer

    i figure it out. This thread can be removed.

    #46350
    xeon
    Customer

    If you would please edit your thread title and add [SOLVED] at the beginning. It will help identify if a post is still active until there is a better way. Otherwise, everyone just has to go through the thread :-)

    Xeon
    Route 66 Digital
    Interactive Solutions

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.