"glTFFileLoader.js" CDN makes page crash, suspecting typo in "interactivityUtils.ts"

Hi everybody !

I’m coming back to Babylon after a year pause, and I started a project involving a GLB file import. It worked fine a few days ago, and today, the page crashes, even when I strip down my entire code.
I found the issue seems to come from the interactivityUtils.ts file located here.
The error shows this :


And apparently, line 78, the gltfToFlowGraphTypeMap object just has a key without double quotes.

I have no idea how the GLTF loader works, but I find the key name (log) and the absent quotes odd, it might be causing the issue.

To reproduce, simply try opening the below index.html in a browser:

<!DOCTYPE html>
<html>
<head>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/babylonjs/6.33.1/babylon.min.js"></script>
  <script src="https://cdn.babylonjs.com/loaders/babylon.glTFFileLoader.js"></script>
</head>

<body>
  <canvas></canvas>
</body>
</html>

Any thoughts on that ?

Oh, interesting. looking into that! Thanks for reporting

This is justa case of version mismatch. I am not sure why you use the loader from our CDN, but the minified babylon from cloudflare, but the version should be consistent. This works:

<!DOCTYPE html>
<html>
<head>
  <script src="https://cdn.babylonjs.com/babylon.js"></script>
  <script src="https://cdn.babylonjs.com/loaders/babylon.glTFFileLoader.js"></script>
</head>

<body>
  <canvas></canvas>
</body>
</html>
1 Like

Hey ! Thanks for the swift reply.

Yes, your solution fixes it for me. Actually I’m still bugged as to how but hey, I’ll take it. I don’t know why I had two different links, I supposed I grabbed the CDN in different places and it was working for a while so I didn’t question it.

The problem is a mismatch in versions. These classes were added quite recently, and i can only assume that the version of babylon you have linked just doesn’t have these classes. You coul dhave used the loader of this specific version and it would work as well:

https://cdn.babylonjs.com/v6.33.1/loaders/babylon.glTFFileLoader.js

2 Likes