Open sigmaSd opened 11 months ago
Also for AsyncDisposableStack
.
@lucacasonato Shouldn't situations like this — where compiling (type-checking) succeeds, but the compiled JavaScript result fails at runtime — be labelled as https://github.com/denoland/deno/labels/bug?
This bug is still present in Deno v1.40.5.
And I agree, this seems like a bug. The VSCode extension and deno check
don't give any error about using DisposableStack
even though it's not implemented and not even a valid identifier in scope.
Just fyi. I'm using the following polyfill and it seems working OK. (thanks to https://deno.land/x/dispose)
import {
AsyncDisposableStack,
DisposableStack,
} from "https://deno.land/x/dispose@1.0.1/mod.ts";
// DisposableStack and AsyncDisposableStack are not available yet.
// https://github.com/denoland/deno/issues/20821
// deno-lint-ignore no-explicit-any
(globalThis as any).DisposableStack ??= DisposableStack;
// deno-lint-ignore no-explicit-any
(globalThis as any).AsyncDisposableStack ??= AsyncDisposableStack;
Bumping this. This issue is present on the latest canary version as of writing.
My deno --version
:
deno 1.43.2+19c0633 (canary, aarch64-apple-darwin)
v8 12.4.254.12
typescript 5.4.5
There's been some movement on this one in the past weeks in V8: https://issues.chromium.org/issues/42203506
We will update to the version that implements DisposableStack
as soon as possible.
The types are there, but it fails at runtime https://github.com/denoland/deno/blob/edeccef4990598620bf5595df6fc8c1b1b1a7f73/cli/tsc/dts/lib.esnext.disposable.d.ts#L53