{"record":{"id":"26c7f048191b19b0","repo":"BabylonJS/Babylon.js","slug":"context-uri-is-missing-or-the-binary-gltf-is-m","errorCode":null,"errorMessage":"${context}: Uri is missing or the binary glTF is missing its binary chunk","messagePattern":"(.+?): Uri is missing or the binary glTF is missing its binary chunk","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/dev/loaders/src/glTF/2.0/Extensions/MSFT_lod.pure.ts","lineNumber":310,"sourceCode":"            this._loader.log(`deferred`);\r\n            const previousIndexLOD = this._materialIndexLOD - 1;\r\n            this._materialSignalLODs[previousIndexLOD] = this._materialSignalLODs[previousIndexLOD] || new Deferred<void>();\r\n            return this._materialSignalLODs[previousIndexLOD].promise.then(async () => {\r\n                return await this._loader.loadUriAsync(context, property, uri);\r\n            });\r\n        }\r\n\r\n        return null;\r\n    }\r\n\r\n    /**\r\n     * @internal\r\n     */\r\n    // eslint-disable-next-line no-restricted-syntax\r\n    public loadBufferAsync(context: string, buffer: IBuffer, byteOffset: number, byteLength: number): Nullable<Promise<ArrayBufferView>> {\r\n        if (this._loader.parent.useRangeRequests && !buffer.uri) {\r\n            if (!this._loader.bin) {\r\n                throw new Error(`${context}: Uri is missing or the binary glTF is missing its binary chunk`);\r\n            }\r\n\r\n            const loadAsync = async (bufferLODs: Array<IBufferInfo>, indexLOD: number) => {\r\n                const start = byteOffset;\r\n                const end = start + byteLength - 1;\r\n                let bufferLOD = bufferLODs[indexLOD];\r\n                if (bufferLOD) {\r\n                    bufferLOD.start = Math.min(bufferLOD.start, start);\r\n                    bufferLOD.end = Math.max(bufferLOD.end, end);\r\n                } else {\r\n                    bufferLOD = { start: start, end: end, loaded: new Deferred() };\r\n                    bufferLODs[indexLOD] = bufferLOD;\r\n                }\r\n\r\n                return await bufferLOD.loaded.promise.then((data) => {\r\n                    return new Uint8Array(data.buffer, data.byteOffset + byteOffset - bufferLOD.start, byteLength);\r\n                });\r\n            };\r","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/loaders/src/glTF/2.0/Extensions/MSFT_lod.pure.ts#L292-L328","documentation":"With MSFT_lod + range requests (HTTP range loading), buffer data must come either from a uri or from the .glb binary chunk. When useRangeRequests is enabled, the buffer has no uri, and the loader has no bin chunk stored (e.g. the .glb lacked its BIN chunk or a .gltf was loaded with range requests), there is no data source and loadBufferAsync throws.","triggerScenarios":"Loading with MSFT_lod extension and loader.parent.useRangeRequests = true where buffer.uri is absent AND loader.bin is null (glb without binary chunk, or range requests on a plain .gltf).","commonSituations":"Enabling useRangeRequests for LOD streaming on .gltf files (JSON-only) instead of .glb; stripping the BIN chunk from a .glb during optimization; serving .glb files without proper range support and combining configs incorrectly.","solutions":["Use a .glb file that contains a valid binary (BIN) chunk when useRangeRequests is true.","Add a uri to the buffer in the glTF so it can be fetched directly.","Disable useRangeRequests (loader.parent.useRangeRequests = false) if full files are available."],"exampleFix":"// before\nloader.useRangeRequests = true; // loading .gltf without buffer uri\n// after\nloader.useRangeRequests = true; // with .glb containing BIN chunk\n// or: loader.useRangeRequests = false;","handlingStrategy":"fallback","validationCode":"if (loader.useRangeRequests && !isGlb(bufferSource)) {\n  throw new Error('Range requests require a .glb with a binary chunk');\n}","typeGuard":null,"tryCatchPattern":"try { await loader.loadAsync(url); } catch (e) {\n  if (e.message.includes('binary chunk')) {\n    loader.useRangeRequests = false;\n    return loader.loadAsync(url); // fallback without range requests\n  } throw e;\n}","preventionTips":["Only enable useRangeRequests with .glb files containing a BIN chunk.","Verify buffers either have uri or rely on the binary chunk, not neither.","Confirm the server supports HTTP Range headers before enabling range loading."],"tags":["gltf","network","lod","buffer"],"backgroundTag":"missing-binary-chunk","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}