opsguy7
opsguy73w ago

superoak and superdeno completeXhrPromises error.

I'm familar new to Deno. I started creating a simple app and wanted to do some simple HTTP assertion first. But i keep getting the below error is this a known issue ? the images attached i believe show what i'm trying to do etc.
./server.test.ts (uncaught error)
error: (in promise) ReferenceError: window is not defined
(window as any)[SHAM_SYMBOL].promises,
^
at completeXhrPromises (https://deno.land/x/superdeno@4.9.0/src/test.ts:192:7)
at https://deno.land/x/superdeno@4.9.0/src/test.ts:558:21
at close (https://deno.land/x/superdeno@4.9.0/src/close.ts:47:52)

info: window global is not available in Deno 2.
hint: Replace `window` with `globalThis`.
This error was not caught from a test and caused the test runner to fail on the referenced module.
It most likely originated from a dangling promise, event/timeout handler or top-level code.
./server.test.ts (uncaught error)
error: (in promise) ReferenceError: window is not defined
(window as any)[SHAM_SYMBOL].promises,
^
at completeXhrPromises (https://deno.land/x/superdeno@4.9.0/src/test.ts:192:7)
at https://deno.land/x/superdeno@4.9.0/src/test.ts:558:21
at close (https://deno.land/x/superdeno@4.9.0/src/close.ts:47:52)

info: window global is not available in Deno 2.
hint: Replace `window` with `globalThis`.
This error was not caught from a test and caused the test runner to fail on the referenced module.
It most likely originated from a dangling promise, event/timeout handler or top-level code.
ENV below. deno 2.1.4 (stable, release, aarch64-apple-darwin) v8 13.0.245.12-rusty typescript 5.6.2 "oak": "https://deno.land/x/oak@v17.1.3/mod.ts", "oakCors": "https://deno.land/x/cors@v1.2.2/mod.ts", "mongodb": "https://deno.land/x/mongo@v0.32.0/mod.ts", "asserts": "https://deno.land/std@0.116.0/testing/asserts.ts", "oakLogger": "https://deno.land/x/oak_logger@1.0.0/mod.ts", "zod": "https://deno.land/x/zod@v3.11.6/mod.ts", "superoak": "https://deno.land/x/superoak@4.8.1/mod.ts"
No description
No description
No description
1 Reply
opsguy7
opsguy7OP2w ago
it's a problem with the packets like i thought. https://github.com/cmorten/superdeno/pull/45
GitHub
Make Deno 2.0 compatible by dxdye · Pull Request #45 · cmorten/supe...
Issue #46 This package is not compatible with Deno 2.0, I made a couple changes, which make it work again. I do some doc on this branch in #46 - maybe have a look at this.. Initially I just wanted ...

Did you find this page helpful?