CDN for glTFFileLoader missing/changed starting in v9.5.0

Hi Babylon.js team!

I’ve been updating local libs every update via the CDN like:

:white_check_mark: https://cdn.babylonjs.com/v9.4.1/loaders/babylon.glTFFileLoader.js
:cross_mark: https://cdn.babylonjs.com/v9.5.0/loaders/babylon.glTFFileLoader.js

Please notice how the link no longer works with v9.5.0.

There is also a .min.js link:

:white_check_mark: https://cdn.babylonjs.com/v9.4.1/loaders/babylon.glTFFileLoader.min.js
:counterclockwise_arrows_button: https://cdn.babylonjs.com/v9.5.0/loaders/babylon.glTFFileLoader.min.js

However, the structure of the JS file changed significantly starting in v9.5.0, and I’m having trouble loading it the way I did with v9.4.1.

I was wondering if maybe there was a config issue? Thank you so much for your help!

checking that as well, thanks for reporting

Thank you so much Raanan! :smile:

@RaananW when you have time, could you please help look into the CDN for glTFFileLoader for the newly released v9.5.2?

.js

:white_check_mark: https://cdn.babylonjs.com/v9.4.1/loaders/babylon.glTFFileLoader.js
:cross_mark: https://cdn.babylonjs.com/v9.5.2/loaders/babylon.glTFFileLoader.js (does not exist)

.min.js:

:white_check_mark: https://cdn.babylonjs.com/v9.4.1/loaders/babylon.glTFFileLoader.min.js
:counterclockwise_arrows_button: https://cdn.babylonjs.com/v9.5.2/loaders/babylon.glTFFileLoader.min.js (exists but different structure compared to v9.4.1, and I’m having trouble loading it the same way I did with v9.4.1)

Thank you so much for all of your help, Raanan!

Can i ask what the difference is when you load it? is it still the same with 9.6.2?
I am working on adding the missing file, though they are identical for quite a long time now. it can be a simple redirect, as we also provide sourcemaps.

Thank you so much for your help, Raanan!

Although the format did change after v9.4.1, I can work with the new format moving forward, so no worries from my end.

To await import() glTFFileLoader in Node.js (rather than browser), I’ve been commenting out a small part of babylon.glTFFileLoader.min.js:


babylon.glTFFileLoader.min.js (v9.4.1 and earlier)

!function(e,t){/*"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babylonjs")):"function"==typeof define&&define.amd?define("babylonjs-loaders",["babylonjs"],t):"object"==typeof exports?exports["babylonjs-loaders"]=t(require("babylonjs")):*/e.LOADERS=t(e.BABYLON)}

babylon.glTFFileLoader.min.js (v9.5.0+)

!function(e,t){/*"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("babylonjs")):"function"==typeof define&&define.amd?define(["exports","babylonjs"],t):*/t((e="undefined"!=typeof globalThis?globalThis:e||self).BABYLON=e.BABYLON||{},e.BABYLON)}

This commenting out helps avoid the error when await import()ing glTFFileLoader in Node.js:

Error: Cannot find module 'babylonjs'
Require stack:
- /home/nonroot/app/lib/babylon/loaders/babylon.glTFFileLoader.min.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1383:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1025:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1030:22)
    at Function._load (node:internal/modules/cjs/loader:1192:37)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:237:24)
    at Module.require (node:internal/modules/cjs/loader:1463:12)
    at require (node:internal/modules/helpers:147:16)
    at /home/nonroot/app/lib/babylon/loaders/babylon.glTFFileLoader.min.js:1:79
    at Object.<anonymous> (/home/nonroot/app/lib/babylon/loaders/babylon.glTFFileLoader.min.js:1:262) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/nonroot/app/lib/babylon/loaders/babylon.glTFFileLoader.min.js'
  ]
}

Because the new part to comment out for the new format has been found, I’m able to move forward with the new format.