From fef158070259ff7e746e261f5759df4a2412b4d0 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Sun, 9 Jun 2024 10:46:42 -0700 Subject: [PATCH] Require loading as a module The issue is wgsl_reflect defines `class Function`. If this code is loaded as a non-module then that ends up overriding the default `Function` class and code that's checking `... instanceof Function` starts failing. There's no easy way for a script to check if it was loaded as a module or a non-module but using `import.meta` ends up requiring it to be loaded as a module. --- src/webgpu-debug-helper.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/webgpu-debug-helper.ts b/src/webgpu-debug-helper.ts index 077e979..10fe318 100644 --- a/src/webgpu-debug-helper.ts +++ b/src/webgpu-debug-helper.ts @@ -6,3 +6,7 @@ import './compute-pass-encoder.js'; import './render-pass-encoder.js'; import './render-bundle-encoder.js'; import './texture.js'; + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const _ = import.meta; // webgpu-debug-helper must be imported as a module with import or `