Wrong code in website?

const device = await adapter.requestDevice();
if (!device) throw Error("Couldn’t request WebGPU logical device.");

Should take into account:

GPUAdapter.requestDevice() will never return null, and it will reject only if the request is invalid, i.e. it exceeds the capabilities of the GPUAdapter.

I think device.lost.then(()=>...) needs to replace that code.

MDN