BabylonJS/Babylon.js · error · Error

"Initialization promises timed out"

Error message

"Initialization promises timed out"

What it means

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.

Source

Thrown at packages/dev/smartFilters/src/smartFilter.ts:200

        this._workWithAggregateFreeGraph(() => {
            this.outputBlock.prepareForRuntime();

            renderTargetGenerator = renderTargetGenerator ?? new RenderTargetGenerator(false);
            renderTargetGenerator.setOutputTextures(this, initializationData);

            this.outputBlock.propagateRuntimeData();

            this._generateCommandsAndGatherInitPromises(initializationData);
        });

        // Wait for all the blocks to be initialized
        if (initializationData.initializationPromises.length > 0) {
            const timeoutPromise = new Promise((resolve) => setTimeout(resolve, InitializationTimeout, true));
            // eslint-disable-next-line github/no-then
            const initializationPromises = Promise.all(initializationData.initializationPromises).then(() => false);
            const timedOut = await Promise.race([initializationPromises, timeoutPromise]);
            if (timedOut) {
                throw new Error("Initialization promises timed out");
            }
        }

        // Register the resources to dispose when the runtime is disposed
        initializationData.disposableResources.forEach((resource) => runtime.registerResource(resource));

        return runtime;
    }

    /**
     * Resizes any intermediate textures according to the new size of the render target
     * @param engine - The engine used to render the smart filter
     */
    public resize(engine: ThinEngine): void {
        this._workWithAggregateFreeGraph(() => {
            this.outputBlock.visit({}, (block: BaseBlock) => {
                if (!(block instanceof ShaderBlock)) {
                    return;

View on GitHub (pinned to 0592b347b8)

Solutions

  1. Increase the InitializationTimeout configuration value.
  2. Preload the textures/assets before calling createRuntimeAsync.
  3. Verify asset URLs are reachable and hosted near the user.
  4. Check network errors/loading failures in the initialization promises themselves.
Defensive patterns

Strategy: try-catch

Validate before calling

// Preload assets so initialization promises resolve fast
await Promise.all(textureUrls.map(u => fetch(u)));

Try / catch

try { const runtime = await SmartFilter.createRuntimeAsync(...); } catch (e) { if (e.message.includes('timed out')) { retryWithLongerTimeoutOrPreloadedAssets(); } else { throw e; } }

Prevention

When it happens

Trigger: One or more initializationData.initializationPromises (asset loads, texture fetches) taking longer than InitializationTimeout milliseconds to resolve.

Common situations: Slow network loading texture URLs; missing/blocked asset URLs; offline environments; heavy main-thread work delaying promise resolution; very large textures.

Understand the failure class

Related errors


AI-assisted analysis of BabylonJS/Babylon.js@0592b347b8 (2026-08-30). Data as JSON: /api/errors/29f7ff3b37728f62. Report an issue: GitHub.