Missing imports for webgpu

I’m on beta 8.

today I changed this line of code
import { UniversalCamera } from ‘@babylonjs/core’;
to this
import { UniversalCamera } from ‘@babylonjs/core/Cameras/universalCamera’;

which resulted in this critical error (only for webgpu, when starting the engine):

this means I am missing import(s) from core somewhere that I’m not using directly (no compile errors).
Does someone see what it is right away?

Are you sure there’s no errors before this one?

createBuffer is a method of GPUDevice, so there should be an error that says that WebGPU could not be initialized/the device could not be created.

Are you creating the WebGPU engine with some code like:

const engine = new BABYLON.WebGPUEngine(canvas);
await engine.initAsync();

?

1 Like

yes, this is the first error for sure.

I remember there used to be the need to globally reference, but I thought it was resolved (apparently I still had one in my code though :pensive:):

I needed these imports:
import ‘@babylonjs/core/Engines/WebGPU/Extensions/engine.uniformBuffer’;
import ‘@babylonjs/core/Engines/WebGPU/Extensions/engine.dynamicTexture’;
import ‘@babylonjs/core/Engines/WebGPU/Extensions/engine.alpha’;
import ‘@babylonjs/core/Engines/WebGPU/Extensions/engine.dynamicBuffer’;

1 Like