GUI seems not to be working when unisng BJS in VueJS

When I import BJS (import * as BABYLON from 'babylonjs') inside VueJS I don’t have access to GUI, so I had to install and import babylonjs-gui manually. (import * as GUI from 'babylonjs-gui').

GUI is working well when I create a Button, but it gives me an error when I try to create inputText/Rectangle/…

The error is:
TypeError: Cannot set property name of #<Object> which has only a getter

It is very hard to help without some form a reproduction. The error is a pure javascript error, something is trying to change a property to which there is no setter. might be some auto-magic thing Vue is doing?

If you can reproduce it simply somewhere, it would be very helpful.

Also, a small suggestion (that I am pretty sure is not going to directly fix this) would be to use out es6 npm packages instead of our UMD packages (@babylonjs/core and @babylonjs/gui), especially if you use a modern library like vue.

1 Like

It worked!!!
You just saved my life. I didn’t know about the ES6 packages.

Thank you very much.

God bless you.

1 Like