Brian Dolan
Brian Dolan

Reputation: 3136

Babylon JS NullEngine not a constructor

Using Babylon 4.2

import * as BABYLON from 'babylonjs';
var engine = new BABYLON.NullEngine();
var scene = new BABYLON.Scene(engine);

Yields

TypeError: BABYLON.NullEngine is not a constructor

In Babylon 4.2. However, the documentation uses this syntax : https://doc.babylonjs.com/typedoc/classes/babylon.nullengine

Upvotes: 1

Views: 766

Answers (1)

TheNoneMan
TheNoneMan

Reputation: 31

Try changing

import * as BABYLON from 'babylonjs';

to

import BABYLON from 'babylonjs';

Worked for me, when writing with Node.js v16

Upvotes: 3

Related Questions