BabylonJS/Babylon.js · error
Freezing active meshes was cancelled
Error message
Freezing active meshes was cancelled
What it means
Scene.freezeActiveMeshes() asks every object renderer to freeze its active meshes; this happens asynchronously via a retry helper (_RetryWithInterval). If any object renderer's freeze step reports failure (ok === false) or is cancelled (notCancelled === false, e.g. due to an error in a renderer), the scene throws this Error to abort the freeze operation instead of leaving the scene half-frozen.
Source
Thrown at packages/dev/core/src/scene.pure.ts:4645
for (const task of objectRendererTasks) {
task.objectRenderer._freezeActiveMeshes(freezeMeshes);
}
// Wait for all object renderers to finish freezing
this._freezeActiveMeshesCancel = _RetryWithInterval(
() => {
let ok = true;
let notCancelled = true;
for (const task of objectRendererTasks) {
ok &&= task.objectRenderer._isFrozen;
notCancelled &&= task.objectRenderer._freezeActiveMeshesCancel !== null;
}
if (ok) {
return true;
} else if (!notCancelled) {
// At least one object renderer cancelled freezing meshes because of an error
// Throws an error that will be caught by _RetryWithInterval.onError
throw new Error("Freezing active meshes was cancelled");
}
return false;
},
() => {
// All meshes of all object renderers could be frozen correctly
this._freezeActiveMeshesCancel = null;
this._activeMeshesFrozen = true;
this._activeMeshesFrozenButKeepClipping = keepFrustumCulling;
this._skipEvaluateActiveMeshesCompletely = skipEvaluateActiveMeshes;
onSuccess?.();
},
(err, isTimeout) => {
// An error occurred => not all meshes could be frozen
// Unfreezes all meshes so that we remain in a valid state
this._freezeActiveMeshesCancel = null;
this.unfreezeActiveMeshes();
if (!isTimeout) {
View on GitHub (pinned to 0592b347b8)
Solutions
- Inspect the object renderers' _freezeActiveMeshes results/logs to find which renderer cancelled and fix the underlying error it hit
- Retry freezeActiveMeshes after the scene and all renderers are fully ready (e.g. after assets finish loading / onReadyObservable fires)
- Avoid mixing custom object renderers with mesh freezing, or ensure their freeze implementation returns true
- If freezing is unstable, remove the freeze call and let the scene evaluate meshes each frame
Example fix
// before
scene.registerBeforeRender(() => { scene.freezeActiveMeshes(); });
// after
scene.executeWhenReady(() => { try { scene.freezeActiveMeshes(); } catch (e) { console.warn('freeze cancelled', e); } }); Defensive patterns
Strategy: try-catch
Validate before calling
// Ensure scene is ready and no problematic object renderers are attached
if (scene.isReady() && scene.progressBar === undefined) {
scene.executeWhenReady(() => scene.freezeActiveMeshes());
} Try / catch
try {
scene.freezeActiveMeshes();
} catch (e) {
if (e instanceof Error && e.message === 'Freezing active meshes was cancelled') {
// fall back to per-frame mesh evaluation; investigate renderer errors
scene.unfreezeActiveMeshes?.();
} else { throw e; }
} Prevention
- Call freezeActiveMeshes only inside scene.executeWhenReady after all assets load
- Keep custom object renderers' freeze implementations error-free and returning true
- Re-freeze (unfreeze then freeze) after dynamic scene changes instead of freezing mid-load
- Log the renderer that cancels to identify the failing component quickly
When it happens
Trigger: Calling scene.freezeActiveMeshes() (or freezeActiveMeshes(update) in a render loop) when at least one attached object renderer errors or cancels during its _freezeActiveMeshes step; the retry/onError path surfaces the cancellation as this thrown error.
Common situations: Performance-tuning a Babylon.js scene by freezing meshes to skip mesh evaluation; custom object renderers or plugins whose freeze callback fails; scenes with renderers attached that are not ready when freeze is attempted.
Related errors
- Geometry buffer renderer is not supported but is required fo
- Active camera not set
- No camera defined
- At least one mesh is needed to create the nav mesh.
- Connect failed
AI-assisted analysis of BabylonJS/Babylon.js@0592b347b8 (2026-08-30).
Data as JSON: /api/errors/de6c302acf2f5c18.
Report an issue: GitHub.