When I run bun run index.ts
I’m getting an error:
npm run start
Debugger attached.
> [email protected] start
> bun run index.ts
11 | dialogCallback;
12 | static PAGE_LOADED = "DOMContentLoaded";
13 | constructor() {
14 | }
15 | static startWhenReady(ClassReference, startWith) {
16 | window.addEventListener(BaseClass.PAGE_LOADED, (event) => {
^
ReferenceError: Can't find variable: window
at startWhenReady (BaseClass.js:16:9)
at index.ts:12:11
Do I need to import something? Or tell Bun somehow that this is going to be run in the browser?