Skip to content

device.addEventListener("uncapturederror", throws an error #4

@stefnotch

Description

@stefnotch

I wrote the following minimal code

import { create, globals } from "webgpu";

Object.assign(globalThis, globals);
const navigator = { gpu: create([]) };

// do some webgpu
const device = await (await navigator.gpu.requestAdapter()).requestDevice();
device.addEventListener("uncapturederror", (a) => {
  console.log(a);
});

which throws an error at runtime

> node a.js                                                                                               
file:///C:/Users/Stefnotch/Downloads/math2model-use-gpu/a.js:8
device.addEventListener("uncapturederror", (a) => {
       ^

TypeError: no overload matched for addEventListener:
object is not of the correct interface type
    at file:///C:/Users/Stefnotch/Downloads/math2model-use-gpu/a.js:8:8

Node.js v23.7.0

Tested with the latest version of this package that is available on npm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions