Hi all,
I developed all locally with a node.js simple webserver where all worked fine. Then I moved it to my remote server and the following root page loads well on Firefox but not on Chrome.
ERROR:
logger.ts:103 BJS - [23:39:31]: Unable to load from https://nostromophoto.com/virtual/root.babylon: loadAssets of undefined from undefined version: undefined, exporter version: undefinedimportScene has failed JSON parse
The error happens under the call to:
BABYLON.SceneLoader.LoadAssetContainer
Any help will be highly appreciated,
LB
EDITED:
It seems the issue of the browser is not really at the root cause. Loading a large asset file (.babylon) with slower networks causes the connection to finish prematurely and triggering the BJS error
Sorry, dont know what you mean by repro
Actually you are right, tried from my another laptop and it loaded with chrome. Checked with a colleague having the same software setup and for her it did not work out. Any clue how to make sense of this?
I use Version 108.0.5359.99 (Official Build) (64-bit) but i dont think that would make much of a difference
I noticed too that if you get in the “pakistan” gallery it will trigger the same error as well for Firefox and Safari.
Hi all,
I did a bit more of research on the browser dev tools. It seems that the failure happens when the .babylon file download ends prematurely. The status code is fine but the transfer size is smaller than what is should.
Chrome shows some message of this kind:
[Violation] ‘readystatechange’ handler took 352ms
Firefox shows nothing.
Questions would be:
does it look like an issue in the server side or the client one?
having a loading bar or a managed loading progress would prevent this problem?
If I can provide something more concrete from the console or alike let me know.
Cheers
LB
Hi @sebavan. If the issue depends on particular network conditions it might be difficult to recreate. Yet those with good knowledge of the internals of babylon could figure out if things are working as expected. The relatively large babylon files (between 10-60 MB) have proper Content-length file size in the http headers, however the actual transfer size (depending on browser and network) is sometimes, hence triggering the error shown at the begining of this thread.
I will try to verify if this is some sort of a packet loss. In that’s the case, babylon (or babylon and supporting libraries) does not seem to handle or even detect it. If I download from the browser the large files, they are downloaded without issues.
any clues on how to compile further info?
ps. i have edited the title and first message to better represent what I’ve learnt on the issue so far
The loaders are using XMLHTTPRequest for compatibility reasons, so I wonder if the result would be different using fetch. Could you try loading the json string through fetch and then loading the data string into Babylon? Loading Any File Type | Babylon.js Documentation (babylonjs.com)
As a summary. The server side seems to be the one cutting off the connection. I put the files on a different server and the issues were gone. Download of large asset may be a problem in some proxy environments too.
However, if there is a Content-length response babylon could try to resume the download of the remaining assets.