{"record":{"id":"ce2c96a007794c03","repo":"BabylonJS/Babylon.js","slug":"not-supported-by-thinengine","errorCode":null,"errorMessage":"Not Supported by ThinEngine","messagePattern":"Not Supported by ThinEngine","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/Engines/thinEngine.pure.ts","lineNumber":1034,"sourceCode":"    }\r\n\r\n    /**\r\n     * End the current frame\r\n     */\r\n    public override endFrame(): void {\r\n        super.endFrame();\r\n        // Force a flush in case we are using a bad OS.\r\n        if (this._badOS) {\r\n            this.flushFramebuffer();\r\n        }\r\n    }\r\n\r\n    /**\r\n     * Gets the performance monitor attached to this engine\r\n     * @see https://doc.babylonjs.com/features/featuresDeepDive/scene/optimize_your_scene#engineinstrumentation\r\n     */\r\n    public get performanceMonitor(): PerformanceMonitor {\r\n        throw new Error(\"Not Supported by ThinEngine\");\r\n    }\r\n\r\n    /**\r\n     * Binds the frame buffer to the specified texture.\r\n     * @param rtWrapper The render target wrapper to render to\r\n     * @param faceIndex The face of the texture to render to in case of cube texture and if the render target wrapper is not a multi render target\r\n     * @param requiredWidth The width of the target to render to\r\n     * @param requiredHeight The height of the target to render to\r\n     * @param forceFullscreenViewport Forces the viewport to be the entire texture/screen if true\r\n     * @param lodLevel Defines the lod level to bind to the frame buffer\r\n     * @param layer Defines the 2d array index to bind to the frame buffer if the render target wrapper is not a multi render target\r\n     */\r\n    public bindFramebuffer(\r\n        rtWrapper: RenderTargetWrapper,\r\n        faceIndex: number = 0,\r\n        requiredWidth?: number,\r\n        requiredHeight?: number,\r\n        forceFullscreenViewport?: boolean,\r","sourceCodeStart":1016,"sourceCodeEnd":1052,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/Engines/thinEngine.pure.ts#L1016-L1052","documentation":"The performanceMonitor getter is not implemented in ThinEngine — only the full Engine class provides a PerformanceMonitor. ThinEngine is the minimal WebGL backend, so this API surface is intentionally unsupported and always throws.","triggerScenarios":"Accessing engine.performanceMonitor on an instance of ThinEngine (or ThinWebGPUEngine-style thin engines) instead of the full Engine class; calling it in library code typed loosely as any engine.","commonSituations":"Using ThinEngine directly for lightweight rendering and assuming the full Engine API exists; sharing utility code between Engine and ThinEngine instances; upgrading refactors that swapped Engine for ThinEngine without auditing API usage.","solutions":["Use the full Engine class (from packages/dev/core/src/Engines/engine.ts) if you need performanceMonitor","Guard the access: check typeof engine.performanceMonitor or instanceof ThinEngine before reading","Implement your own PerformanceMonitor around render loop timing if staying on ThinEngine","Track engine feature support via the engine's capabilities instead of assuming full Engine API"],"exampleFix":"// before\nconst fps = engine.performanceMonitor.average; // throws on ThinEngine\n// after\nif (!(engine instanceof ThinEngine)) {\n    const fps = engine.performanceMonitor.average;\n}","handlingStrategy":"type-guard","validationCode":"function supportsPerformanceMonitor(engine: unknown): boolean {\n  return !(engine instanceof ThinEngine);\n}","typeGuard":"function hasPerformanceMonitor(e: any): e is { performanceMonitor: PerformanceMonitor } {\n  return e && typeof e === 'object' && 'performanceMonitor' in e && !(e instanceof ThinEngine);\n}","tryCatchPattern":"try {\n  const avg = (engine as any).performanceMonitor.average;\n} catch (e) {\n  if ((e as Error).message === 'Not Supported by ThinEngine') {\n    const avg = ownFrameTimeAverager(); // custom fallback\n  }\n}","preventionTips":["Use the full Engine class when you need Engine-level features (monitor, deltas, etc.)","Wrap thin-engine access behind an interface that only declares supported APIs","List ThinEngine exclusions when writing engine-agnostic utility code","Add an instanceof check before accessing optional engine APIs"],"tags":["api-support","thinengine"],"backgroundTag":"not-supported-by-engine","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}