diff --git a/mod.ts b/mod.ts index 846c64b..fad38c3 100644 --- a/mod.ts +++ b/mod.ts @@ -13,6 +13,14 @@ import { CPU, type CPUBackendLoader } from "./src/backends/cpu/mod.ts"; import { WASM, type WASMBackendLoader } from "./src/backends/wasm/mod.ts"; import type { BackendLoader } from "./src/core/engine.ts"; +onerror = () => { + if (typeof Deno == "undefined") { + throw new Error( + "Warning: Deno is not defined. Did you mean to import from ./web.ts instead of ./mod.ts?", + ); + } +}; + /** * The AUTO backend is chosen automatically based on the environment. */ diff --git a/src/core/engine.ts b/src/core/engine.ts index 8fdc0a6..2d0ba5a 100644 --- a/src/core/engine.ts +++ b/src/core/engine.ts @@ -2,14 +2,6 @@ import { WASM } from "../backends/wasm/mod.ts"; import type { Sequential } from "./mod.ts"; import type { Backend, BackendType, NetworkConfig } from "./types.ts"; -onerror = () => { - if (typeof Deno == "undefined") { - throw new Error( - "Warning: Deno is not defined. Did you mean to import from ./web.ts instead of ./mod.ts?", - ); - } -}; - export interface BackendInstance { /** * Initialize the backend.