{"record":{"id":"29f7ff3b37728f62","repo":"BabylonJS/Babylon.js","slug":"initialization-promises-timed-out","errorCode":null,"errorMessage":"\"Initialization promises timed out\"","messagePattern":"\"Initialization promises timed out\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/smartFilters/src/smartFilter.ts","lineNumber":200,"sourceCode":"        this._workWithAggregateFreeGraph(() => {\r\n            this.outputBlock.prepareForRuntime();\r\n\r\n            renderTargetGenerator = renderTargetGenerator ?? new RenderTargetGenerator(false);\r\n            renderTargetGenerator.setOutputTextures(this, initializationData);\r\n\r\n            this.outputBlock.propagateRuntimeData();\r\n\r\n            this._generateCommandsAndGatherInitPromises(initializationData);\r\n        });\r\n\r\n        // Wait for all the blocks to be initialized\r\n        if (initializationData.initializationPromises.length > 0) {\r\n            const timeoutPromise = new Promise((resolve) => setTimeout(resolve, InitializationTimeout, true));\r\n            // eslint-disable-next-line github/no-then\r\n            const initializationPromises = Promise.all(initializationData.initializationPromises).then(() => false);\r\n            const timedOut = await Promise.race([initializationPromises, timeoutPromise]);\r\n            if (timedOut) {\r\n                throw new Error(\"Initialization promises timed out\");\r\n            }\r\n        }\r\n\r\n        // Register the resources to dispose when the runtime is disposed\r\n        initializationData.disposableResources.forEach((resource) => runtime.registerResource(resource));\r\n\r\n        return runtime;\r\n    }\r\n\r\n    /**\r\n     * Resizes any intermediate textures according to the new size of the render target\r\n     * @param engine - The engine used to render the smart filter\r\n     */\r\n    public resize(engine: ThinEngine): void {\r\n        this._workWithAggregateFreeGraph(() => {\r\n            this.outputBlock.visit({}, (block: BaseBlock) => {\r\n                if (!(block instanceof ShaderBlock)) {\r\n                    return;\r","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/smartFilters/src/smartFilter.ts#L182-L218","documentation":"createRuntimeAsync waits for all block initialization promises (e.g. texture/asset loads) with a hard timeout (InitializationTimeout). If the promises have not settled before the timeout fires, the runtime creation is aborted and this error is thrown so callers do not get a half-initialized runtime.","triggerScenarios":"One or more initializationData.initializationPromises (asset loads, texture fetches) taking longer than InitializationTimeout milliseconds to resolve.","commonSituations":"Slow network loading texture URLs; missing/blocked asset URLs; offline environments; heavy main-thread work delaying promise resolution; very large textures.","solutions":["Increase the InitializationTimeout configuration value.","Preload the textures/assets before calling createRuntimeAsync.","Verify asset URLs are reachable and hosted near the user.","Check network errors/loading failures in the initialization promises themselves."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Preload assets so initialization promises resolve fast\nawait Promise.all(textureUrls.map(u => fetch(u)));","typeGuard":null,"tryCatchPattern":"try { const runtime = await SmartFilter.createRuntimeAsync(...); } catch (e) { if (e.message.includes('timed out')) { retryWithLongerTimeoutOrPreloadedAssets(); } else { throw e; } }","preventionTips":["Preload textures before createRuntimeAsync.","Raise InitializationTimeout for slow networks.","Log/monitor initialization promise durations.","Handle offline/404 asset URLs up front."],"tags":["async","timeout","initialization"],"backgroundTag":"initialization-promise-timeout","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}