regna
May 2, 2026, 5:40pm
1
Hi Babylon.js team!
I’ve been updating local libs every update via the CDN like:
https://cdn.babylonjs.com/v9.4.1/loaders/babylon.glTFFileLoader.js
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:
https://cdn.babylonjs.com/v9.4.1/loaders/babylon.glTFFileLoader.min.js
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
regna
May 4, 2026, 10:23pm
4
Thank you so much Raanan!
regna
May 6, 2026, 8:49pm
5
@RaananW when you have time, could you please help look into the CDN for glTFFileLoader for the newly released v9.5.2?
.js
https://cdn.babylonjs.com/v9.4.1/loaders/babylon.glTFFileLoader.js
https://cdn.babylonjs.com/v9.5.2/loaders/babylon.glTFFileLoader.js (does not exist)
.min.js:
https://cdn.babylonjs.com/v9.4.1/loaders/babylon.glTFFileLoader.min.js
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.
master ← RaananW:fix-umd-multi-entry-aliases
opened 11:17AM - 11 May 26 UTC
> 🤖 *This PR was created by the create-pr skill.*
## Summary
Fixes the UMD pro… duction build helper so multi-entry packages copy the secondary filename alias for each entry after that entry's output exists.
Previously, the `copyMinToMaxPlugin` was attached only to the first Rollup config for multi-entry packages, but it attempted to copy aliases for every entry. Because later entry outputs had not been written yet, only the first/main package bundle received both published names.
## Motivation
A forum report noted that the versioned CDN URL for the regular glTF loader alias was missing starting in 9.5.x:
https://forum.babylonjs.com/t/cdn-for-gltffileloader-missing-changed-starting-in-v9-5-0/63314/5?u=raananw
For example, `v9.5.2/loaders/babylon.glTFFileLoader.min.js` exists, but `v9.5.2/loaders/babylon.glTFFileLoader.js` returns 404.
## What was missing
The issue was broader than the glTF loader. In versioned CDN releases, the individual entry aliases were missing for multi-entry UMD packages while their `.min.js` files existed:
- `loaders`: individual loader aliases such as `babylon.glTFFileLoader.js`
- `materialsLibrary`: individual material aliases such as `babylon.gridMaterial.js`
- `proceduralTexturesLibrary`: individual procedural texture aliases
- `postProcessesLibrary`: individual post-process aliases
- `serializers`: individual serializer aliases
The package-level bundles, such as `babylonjs.loaders.js` and `babylonjs.loaders.min.js`, were still present.
## Fix
In multi-entry mode, attach `copyMinToMaxPlugin` to every per-entry Rollup config and scope it to the current `chunkName`. This ensures the secondary alias is copied after the corresponding output file exists.
Single-entry packages, including the main `babylonjs` package (`babylon.js` / `babylon.max.js`), continue through the unchanged single-config path.
## Validation
Ran:
```bash
npm run build:prod -w babylonjs-loaders
```
Confirmed the build now emits both names for every loader entry, including:
```text
babylon.glTFFileLoader.min.js
babylon.glTFFileLoader.js
babylon.objFileLoader.min.js
babylon.objFileLoader.js
babylonjs.loaders.min.js
babylonjs.loaders.js
```
regna
May 20, 2026, 5:55pm
7
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.