{"record":{"id":"e1f211962d900635","repo":"BabylonJS/Babylon.js","slug":"editableinpropertypage-decorator-metadata-is-unav-e1f211","errorCode":null,"errorMessage":"EditableInPropertyPage: decorator metadata is unavailable; the Symbol.metadata (${String(MetadataSymbol)}) polyfill must run before decorated classes are evaluated.","messagePattern":"EditableInPropertyPage: decorator metadata is unavailable; the Symbol\\.metadata \\((.+?)\\) polyfill must run before decorated classes are evaluated\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/dev/smartFilters/src/editorUtils/editableInPropertyPage.ts","lineNumber":107,"sourceCode":" * @param propertyType - the type of the property\r\n * @param groupName - the group name of the property\r\n * @param options - the options of the property\r\n * @returns the decorator\r\n */\r\nexport function EditableInPropertyPage(\r\n    displayName: string,\r\n    propertyType: PropertyTypeForEdition = PropertyTypeForEdition.Boolean,\r\n    groupName: string = \"PROPERTIES\",\r\n    options?: IEditablePropertyOption\r\n) {\r\n    return (_value: unknown, context: { name: string | symbol; metadata: DecoratorMetadataObject }) => {\r\n        const meta = context.metadata as DecoratorMetadataObject | undefined;\r\n        if (!meta) {\r\n            // `context.metadata` is `void 0` when `Symbol.metadata` was not installed before this class\r\n            // was evaluated. Importing `MetadataSymbol` from core runs the polyfill at module load (before\r\n            // this class body), so this should never happen; referencing it here also keeps that\r\n            // module-load polyfill anchored against bundler tree-shaking.\r\n            throw new Error(\r\n                `EditableInPropertyPage: decorator metadata is unavailable; the Symbol.metadata (${String(MetadataSymbol)}) polyfill must run before decorated classes are evaluated.`\r\n            );\r\n        }\r\n        let propStore: IPropertyDescriptionForEdition[];\r\n        if (Object.prototype.hasOwnProperty.call(meta, __bjsSmartFilterPropStoreKey)) {\r\n            propStore = meta[__bjsSmartFilterPropStoreKey] as IPropertyDescriptionForEdition[];\r\n        } else {\r\n            propStore = [];\r\n            meta[__bjsSmartFilterPropStoreKey] = propStore;\r\n        }\r\n\r\n        const propertyKey = String(context.name);\r\n\r\n        const propToAdd: IPropertyDescriptionForEdition = {\r\n            propertyName: propertyKey,\r\n            displayName: displayName,\r\n            type: propertyType,\r\n            groupName: groupName,\r","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/smartFilters/src/editorUtils/editableInPropertyPage.ts#L89-L125","documentation":"The EditableInPropertyPage decorator (Stage decorator API) stores property-editing metadata on context.metadata, which is only populated when Symbol.metadata is installed (native or via the MetadataSymbol polyfill from core). If a decorated class is evaluated before the polyfill runs, context.metadata is undefined and this error is thrown. It is deliberately a hard failure so decorated classes are never silently stripped of editor metadata.","triggerScenarios":"Importing a module containing @editableInPropertyPage-decorated classes without first importing MetadataSymbol from core; bundler tree-shaking removing the polyfill import; circular imports where the decorated class module loads before the polyfill module.","commonSituations":"Reordering imports after a refactor; a bundler (Vite/Rollup/webpack) dropping a side-effect-only import it considers unused; migrating Babylon.js versions where the Symbol.metadata polyfill was introduced.","solutions":["Import MetadataSymbol from core at the very top of your entry point (e.g. import 'core/Misc/decorator.metadata' equivalent) so the polyfill runs before any decorated class loads.","Keep the polyfill import side-effectful (do not rely on named bindings bundlers may tree-shake).","Fix import cycles so the polyfill module is not loaded after decorated class modules.","Use a JS runtime/engine version that supports native Symbol.metadata."],"exampleFix":"// before\nimport { EditableInPropertyPage } from \"@babylonjs/smartFilters/Editor/editableInPropertyPage\";\nimport { MyBlock } from \"./myBlock\";\n// after\nimport { MetadataSymbol } from \"@babylonjs/core/Misc/metadata.symbol\"; // polyfill side-effect first\nimport { EditableInPropertyPage } from \"@babylonjs/smartFilters/Editor/editableInPropertyPage\";\nimport { MyBlock } from \"./myBlock\";","handlingStrategy":"validation","validationCode":"if (typeof Symbol.metadata === \"undefined\") {\n  // polyfill not installed yet\n  throw new Error(\"Import MetadataSymbol from core before importing decorated classes\");\n}","typeGuard":"null","tryCatchPattern":"try {\n  const mod = await import(\"./blocks/decoratedBlocks\");\n} catch (e) {\n  if (String(e).includes(\"decorator metadata is unavailable\")) {\n    console.error(\"Ensure the Symbol.metadata polyfill import precedes decorated class imports\");\n  } else throw e;\n}","preventionTips":["Import the MetadataSymbol polyfill as the first import in your app entry point.","Mark the polyfill import as side-effectful so bundlers do not tree-shake it.","Avoid import cycles between decorated class modules and the polyfill module.","Prefer runtimes with native Symbol.metadata support."],"tags":["decorators","module-load-order","polyfill"],"backgroundTag":"decorator-metadata-missing","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}