Missing side effect for CreateLineSystrem

I am trying to incorporate CreateLineSystem into. my Typescript/ES6 application. I get an error when importing only the particular file such as:

import { CreateLineSystem } from '@babylonjs/core/Meshes/Builders/linesBuilder';
core.mjs:11760 ERROR TypeError: Cannot read properties of undefined (reading 'SRC_ALPHA')
    at _Engines_thinEngine_js__WEBPACK_IMPORTED_MODULE_0__.ThinEngine.setAlphaMode (engine.alpha.js:30:71)
    at LinesMesh.render (mesh.js:1893:20)
    at SubMesh.render (subMesh.js:349:29)
    at RenderingGroup._RenderSorted (renderingGroup.js:202:21)
    at RenderingGroup._renderTransparentSorted (renderingGroup.js:162:31)
    at RenderingGroup.render (renderingGroup.js:127:22)
    at RenderingManager.render (renderingManager.js:125:28)
    at Scene._renderForCamera (scene.js:3502:32)
    at Scene._processSubCameras (scene.js:3527:18)
    at Scene.render (scene.js:3785:18)

However, the application works when I import from @babylonjs/core.

I guess I am missing some sideeffect import. Does anyone know which one I am missing? Or am I on the wrong page?

Best regards,

How do you import MeshBuilder?

Try import @babylonjs/core/Engines/Extensions/engine.alpha.ts. If it does not work, try import @babylonjs/core/Engines/Extensions/.

Hi Evgeni_Popov,
unfortunately, both do not work. After reading labris’ comment, I also tried importing @babylonjs/core/Meshes/meshBuilder as it is mentioned as possible missing side effect in the three shaking docs, also without luck.

For now, I have to continue to import @babylonjs/core until we find it.

Thank you so far and best regards,

Are you using WebGL or WebGPU? Your first error message would mean that this._gl is undefined, which is not (shouldn’t be) possible in WebGL…

Its WebGPU.

Ah, in that case you should use import "@babylonjs/core/Engines/WebGPU/Extensions/engine.alpha.ts" or import "@babylonjs/core/Engines/WebGPU/Extensions/" .

1 Like

Works, thank you!