Jump to content

XMLHttpRequest Error, but still works?


Xeonzinc
 Share

Recommended Posts

Hi,

 

Currently i create my ground mesh from a height map which is created dynamically on the canvas with:

world_map = canvas.toDataURL();

This is then just passed to the CreateGroundFromHeightMap function, where it creates the height map. Everything works fine when i run this at the start of my program.

 

Now I'm working on rebuilding the ground in game, however whenever I run the same functions again everything still works (the new canvas height map is created, put into a dataURL and the mesh is constructed) but once all the other functions have finished I get this error:

XMLHttpRequest cannot load data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALEAAADUCAYAAADTEMIsAAAgAElEQ…gmrCfUWUWMxNTwxuXZjRsTzpS8riZwYmpFxXufWonXYPoMikF/INIzW/MAAAAASUVORK5CYII=. Received an invalid response. Origin 'http://54.213.159.7' is therefore not allowed access.babylon.js:3 BJS - [17:15:18]: Error in XHR request in BABYLON.Database.

I don't really understand why I'm getting this error when:

     a ) The image is getting used babylon without problem before the error is thrown

     b ) There is no error when i first run the process (and I'm disposing of everything as far as i can tell)

Link to comment
Share on other sites

A sneaky hint.  There is only one place in the framework that reports "Error in XHR request in BABYLON.Database"...

 

https://github.com/BabylonJS/Babylon.js/blob/master/Babylon/Tools/babylon.database.ts#L298

 

and of course...

 

https://github.com/BabylonJS/Babylon.js/blob/master/Babylon/Tools/babylon.database.js#L235

 

A guy COULD localize (hijack) BABYLON.Database.prototype._saveImageIntoDBAsync function... putting it inside one's own code.  Put a little console.log in it to make sure the project is running YOUR new localized version.

 

Then fill that puppy full of alerts and logs and try/catch, and maybe you can see what's happening.  And maybe not.  :)  Once you "borrow" a function from the framework and get it into your own code, you can stick probes and sensors all over it.  Make it talk.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...