{"record":{"id":"9ea5a7dc7608ef25","repo":"BabylonJS/Babylon.js","slug":"import-meshbuilder-to-populate-this-function","errorCode":null,"errorMessage":"Import MeshBuilder to populate this function","messagePattern":"Import MeshBuilder to populate this function","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/Meshes/mesh.pure.ts","lineNumber":5449,"sourceCode":"     * @param _scene defines the hosting scene\r\n     * @param _updatable defines if the mesh must be flagged as updatable\r\n     * @param _sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)\r\n     * @param _instance defines an instance of an existing Ribbon object to be updated with the passed `pathArray` parameter (https://doc.babylonjs.com/how_to/How_to_dynamically_morph_a_mesh#ribbon)\r\n     * @returns a new Mesh\r\n     * @deprecated Please use MeshBuilder instead\r\n     */\r\n    public static CreateRibbon(\r\n        _name: string,\r\n        _pathArray: Vector3[][],\r\n        _closeArray: boolean,\r\n        _closePath: boolean,\r\n        _offset: number,\r\n        _scene?: Scene,\r\n        _updatable?: boolean,\r\n        _sideOrientation?: number,\r\n        _instance?: Mesh\r\n    ): Mesh {\r\n        throw new Error(\"Import MeshBuilder to populate this function\");\r\n    }\r\n\r\n    /**\r\n     * Creates a plane polygonal mesh.  By default, this is a disc.\r\n     * @param _name defines the name of the mesh to create\r\n     * @param _radius sets the radius size (float) of the polygon (default 0.5)\r\n     * @param _tessellation sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc\r\n     * @param _scene defines the hosting scene\r\n     * @param _updatable defines if the mesh must be flagged as updatable\r\n     * @param _sideOrientation defines the mesh side orientation (https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation)\r\n     * @returns a new Mesh\r\n     * @deprecated Please use MeshBuilder instead\r\n     */\r\n    public static CreateDisc(_name: string, _radius: number, _tessellation: number, _scene: Nullable<Scene>, _updatable?: boolean, _sideOrientation?: number): Mesh {\r\n        throw new Error(\"Import MeshBuilder to populate this function\");\r\n    }\r\n\r\n    /**\r","sourceCodeStart":5431,"sourceCodeEnd":5467,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/Meshes/mesh.pure.ts#L5431-L5467","documentation":"mesh.pure.ts is the tree-shakeable \"pure\" build of the Mesh class: static legacy mesh-creation helpers are deliberately unimplemented stubs that throw. The real implementations live in MeshBuilder, which must be imported so its side effects populate these functions.","triggerScenarios":"Calling any deprecated static factory on Mesh — here `Mesh.CreatePolygon`-style overload at line 5449 — without importing the MeshBuilder module (`import \"@babylonjs/core/Meshes/meshBuilder\"` or the full core bundle).","commonSituations":"Tree-shaken ES6 builds where only Mesh is imported; migrating legacy code that used `Mesh.CreateX(...)` to the modular Babylon packages; copy-pasting old snippets from pre-4.x tutorials.","solutions":["Add `import \"@babylonjs/core/Meshes/MeshBuilder\";` (side-effect import) once at entry point.","Better: replace `Mesh.CreateX(...)` calls with `MeshBuilder.CreateX(...)` directly.","Alternatively import from the full UMD bundle `@babylonjs/core` where MeshBuilder is auto-registered."],"exampleFix":"// before\nimport { Mesh } from \"@babylonjs/core/Meshes/mesh\";\nconst m = Mesh.CreateDisc(\"d\", 1, 32, scene); // throws\n// after\nimport { MeshBuilder } from \"@babylonjs/core/Meshes/meshBuilder\";\nconst m = MeshBuilder.CreateDisc(\"d\", { radius: 1, tessellation: 32 }, scene);","handlingStrategy":"fallback","validationCode":"// ensure MeshBuilder is loaded before legacy calls\nimport \"@babylonjs/core/Meshes/MeshBuilder\";\nfunction legacyMeshFactoryReady(): boolean {\n  try { Mesh.CreateDisc(\"__probe__\", 0.1, 3, null as any); } catch { return false; }\n  return true;\n}","typeGuard":null,"tryCatchPattern":"try {\n  const m = Mesh.CreateDisc(\"d\", 1, 32, scene);\n} catch (e) {\n  if ((e as Error).message.includes(\"Import MeshBuilder\")) {\n    const m = MeshBuilder.CreateDisc(\"d\", { radius: 1, tessellation: 32 }, scene);\n  }\n}","preventionTips":["Import \"@babylonjs/core/Meshes/MeshBuilder\" as a side-effect import at app entry.","Grep for `Mesh.Create` and migrate to `MeshBuilder.Create` calls.","Avoid the deprecated static API in new code."],"tags":["mesh","tree-shaking","modular-import"],"backgroundTag":"meshbuilder-not-imported","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}