vscode_deno icon indicating copy to clipboard operation
vscode_deno copied to clipboard

Inconsistent behaviour when using triple-slash directives

Open smitssjors opened this issue 1 year ago • 3 comments

Describe the bug Fresh projects include the following triple-slash directives in the main.ts file.

/// <reference no-default-lib="true" />
/// <reference lib="dom" />
/// <reference lib="dom.iterable" />
/// <reference lib="dom.asynciterable" />
/// <reference lib="deno.ns" />

Now sometimes using unstable APIs does not give an error in the editor but sometimes it does, for example in the SaaSKit project (see https://github.com/denoland/saaskit/pull/279). Setting "deno.unstable": true does not have any effect.

To Reproduce

I have no idea how to reproduce this. After creating a new clone of the SaaSKit project the error went away but I am not sure why since it was of the same version.

Expected behavior

I expect that using unstable APIs would result in a error, unless explicitly enabled.

Screenshots

image

Error message: Property 'openKv' does not exist on type 'typeof Deno'. Did you mean 'open'?

Versions

vscode: 1.79.2 deno: 1.34.3 extension: 3.19.1

smitssjors avatar Jun 22 '23 16:06 smitssjors

I have set the extension config

"deno.unstable": true

but Deno.openKv() is not recognized.

image

If I add

/// <reference lib="deno.unstable" />

It is recognized.

image

I was under the impression that setting deno.unstable to true should be enough. What is the expected behavior here?

  • vscodium 1.80.0
  • deno 1.35.1
  • extension v3.19.1

zwn avatar Jul 18 '23 09:07 zwn

@dsherret do you consider this fixed with https://github.com/denoland/deno/pull/19825?

bartlomieju avatar Jul 18 '23 10:07 bartlomieju

This is caused by https://github.com/denoland/deno/issues/9541 I assume.

nayeemrmn avatar Oct 13 '23 17:10 nayeemrmn