{"record":{"id":"91377c441caf8f41","repo":"BabylonJS/Babylon.js","slug":"method-not-implemented","errorCode":null,"errorMessage":"Method not implemented.","messagePattern":"Method not implemented\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/Particles/thinParticleSystem.pure.ts","lineNumber":777,"sourceCode":"                        index--;\r\n                    }\r\n                    continue;\r\n                }\r\n            }\r\n        };\r\n    }\r\n\r\n    /** @internal */\r\n    public _emitFromParticle: (particle: Particle) => void = (_particle) => {\r\n        // Do nothing\r\n    };\r\n\r\n    /**\r\n     * Serializes the particle system to a JSON object.\r\n     * @param _serializeTexture Whether to serialize the texture information\r\n     */\r\n    serialize(_serializeTexture: boolean) {\r\n        throw new Error(\"Method not implemented.\");\r\n    }\r\n\r\n    /**\r\n     * Clones the particle system.\r\n     * @param name The name of the cloned object\r\n     * @param newEmitter The new emitter to use\r\n     * @param _cloneTexture Also clone the textures if true\r\n     */\r\n    public clone(name: string, newEmitter: any, _cloneTexture = false): ThinParticleSystem {\r\n        throw new Error(\"Method not implemented.\");\r\n    }\r\n\r\n    private _syncLifeTimeCreation() {\r\n        if (this.targetStopDuration && this._lifeTimeGradients && this._lifeTimeGradients.length > 0) {\r\n            this._lifeTimeCreation.process = _CreateLifeGradientsData;\r\n            return;\r\n        }\r\n\r","sourceCodeStart":759,"sourceCodeEnd":795,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/Particles/thinParticleSystem.pure.ts#L759-L795","documentation":"ThinParticleSystem.serialize() is an intentionally unimplemented stub. The thin (pure) particle system base is a rendering/kernel core not meant to be serialized directly; full serialization support lives in concrete subclasses like ParticleSystem. Calling serialize on a bare ThinParticleSystem always throws.","triggerScenarios":"Calling thinParticleSystem.serialize(true|false) on an instance typed as ThinParticleSystem (not a ParticleSystem subclass) — e.g. via SceneSerializer walking components, or custom code holding a ThinParticleSystem reference.","commonSituations":"Saving a scene that contains a raw ThinParticleSystem; using ThinParticleSystem directly instead of ParticleSystem; custom frameworks that treat all particle systems uniformly with serialize().","solutions":["Use ParticleSystem (or a subclass that implements serialize) instead of ThinParticleSystem directly.","Override serialize in your own subclass if you need custom serialization.","Guard: skip serialization when the instance is exactly ThinParticleSystem (check constructor/prototype)."],"exampleFix":"// before\nconst ps = new ThinParticleSystem(\"p\", 100, scene);\nconst json = ps.serialize(true);\n// after\nconst ps = new ParticleSystem(\"p\", 100, scene);\nconst json = ps.serialize(true);","handlingStrategy":"type-guard","validationCode":"if (!(ps instanceof ParticleSystem)) throw new Error(\"Serialization requires a ParticleSystem subclass\");","typeGuard":"function isSerializable(ps: ThinParticleSystem): ps is ParticleSystem {\n  return typeof ps.serialize === \"function\" &&\n    Object.getPrototypeOf(ps).constructor !== ThinParticleSystem;\n}","tryCatchPattern":"try {\n  const json = ps.serialize(true);\n} catch (e) {\n  if (e.message === \"Method not implemented.\") {\n    console.warn(\"ThinParticleSystem cannot be serialized; use ParticleSystem\");\n  }\n}","preventionTips":["Use ParticleSystem, not ThinParticleSystem, for scene-level work.","Never assume base-class API (serialize/clone) exists on thin classes.","Check Babylon.js docs for which methods thin classes implement."],"tags":["serialization","unimplemented","particle-system"],"backgroundTag":"method-not-implemented","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}