Errors while building for nuxt using babylonjs ES6

Hello and thank you for being a member of the community!
If you want to report a bug, please make sure to share a repro on the forum:

https://doc.babylonjs.com/divingDeeper/developWithBjs/forum

This is what I have tried till now

I started off with

 import * as BABYLON from '@babylonjs/core'
  import * as GUI from '@babylonjs/gui';

In my component

Works very well in development

I build the project
I get the below error

TypeError: n.getInputElement is not a function. It seems to me that tree shaking is leaving some files which don’t what they are. And I have to include them. I dont know what they are.

I am specifically getting an error here

new BABYLON.Scene(engine)

Does engine has to be a class of abstractEngine?
I would like to get help regarding this. Thanks

engine has to be one of the Engine classes who are all based of AbstractEngine.

How do you instantiate engine ?

engine = new Engine(canvasElement, true)

The issue seems to have resolved with all @babylon packages downgraded to 7.0.0

I will see if I can figure which version is causing this issue. Will update soon

1 Like