Link Babylon.js script from server

Hi There!

I’m wanted to use babylon.js from a local file path from the server, but somehow it does not work. I downloaded the stable versions (before i used the beta versions) and saved them in a folder.

<script src="https://preview.babylonjs.com/babylon.js"></script>
<script src="https://preview.babylonjs.com/loaders/babylonjs.loaders.min.js"></script>
<script src="https://preview.babylonjs.com/gui/babylon.gui.min.js"></script>

now:

<script type="text/javascript" src="/babylon/babylon.js"></script>
<script type="text/javascript" src="/babylon/babylonjs.loaders.min.js"></script>
<script type="text/javascript" src="/babylon/babylon.gui.min.js"></script>

the error i’m getting in the browser:

babylon.js:16 BJS - [08:16:49]: Unable to load from models//2019//V2/***.gltf: Cannot read property ‘asset’ of undefined

Am I missing something basic?

Thanks!

How do you import your gltf file?

with:

BABYLON.SceneLoader.Append

is there any error on the console or network profiler?

Turns out that it only works with the preview version of babylon.js. So i downloaded the preview version, stored it locally on the server - now it works.

<script type="text/javascript" src="/babylon/babylon.js"></script>
<script type="text/javascript" src="/babylon/babylonjs.loaders.min.js"></script>
<script type="text/javascript" src="/babylon/babylon.gui.min.js"></script>

Thanks for helping

1 Like