Argument of type 'import("babylonjs/scene").Scene' is not assignable to parameter of type 'BABYLON.Scene'

Hi, I got this error “Argument of type ‘import(“babylonjs/scene”).Scene’ is not assignable to parameter of type ‘BABYLON.Scene’.” How can I fix it?

class Game {
	private _scene: Scene;
	private _canvas: HTMLCanvasElement;
	private _engine: Engine;

	constructor() {
		this._canvas = this._createCanvas();

	private _createCanvas() {
		this._canvas = document.createElement('canvas'); = '100%'; = '100%'; = 'gameCanvas';
		return this._canvas;

	private _createScene() {
		this._engine = new Engine(this._canvas, true);
		this._scene = new Scene(this._engine);

		this._engine.runRenderLoop(() => {
		window.addEventListener('resize', () => {

	private _example() {
		let scene = new Scene(this._engine);
		const camera = new BABYLON.ArcRotateCamera(
			-Math.PI / 2,
			Math.PI / 2.5,
			new BABYLON.Vector3(0, 0, 0),
		camera.attachControl(this._canvas, true);

		const light = new BABYLON.HemisphericLight('light', new BABYLON.Vector3(0, 1, 0), scene);

		const box = BABYLON.MeshBuilder.CreateBox('box', {});
new Game();

You can not mix imports and global namespace in one project you should either use BABYLON. everywhere or import … from to rely on babylon objects

I’m kinda new to this. What do you mean?

In your code I can see: new Scene meaning here you probably have a import { scene } from ... in your file.

I also see new BABYLON.ArcRotateCamera... and other BABYLON... statements.

Unfortunately those two ways of interacting with Babylon are not compatible. I you are new to it, always using BABYLON. without import might be simpler.

If you are used to JS, just import everything.