Hiro
Hiro16mo ago

Property 'openKv' does not exist on type 'typeof Deno'. VSCode

Such as the title say, I cant get the LSP to recognize openKv in the Deno namespace... deno 1.32.5+78b630d (canary, x86_64-apple-darwin) v8 11.2.214.15 typescript 5.0.3 Any idea ?
31 Replies
crowlKats
crowlKats16mo ago
do you have unstable enabled?
samme
samme16mo ago
Same here
{
"deno.enable": true,
"deno.unstable": true
}
{
"deno.enable": true,
"deno.unstable": true
}
NDH
NDH16mo ago
I've notice that that is not enough. I have use the --unstable flag in the deno run cli command.
EthanThatOneKid
EthanThatOneKid16mo ago
I can't access any unstable APIs in VSCode either. Even with the suggested .vscode/settings.json settings.
# deno --version
deno 1.33.1 (release, x86_64-pc-windows-msvc)
v8 11.4.183.1
typescript 5.0.3
# deno --version
deno 1.33.1 (release, x86_64-pc-windows-msvc)
v8 11.4.183.1
typescript 5.0.3
Are there any other places to enable unstable? I have unstable enabled in VSCode, but the same error is still there. @crowlkats is it possible this is a Windows problem?
ioB
ioB16mo ago
I'm experiencing the same thing but on mac os
NDH
NDH16mo ago
No issue here on Windows. try refreshing deno lsp by ctrl+shift+p then Deno: Initialize Workspace I've used that in past to clear such issues.
samme
samme16mo ago
still same issue on macos. tried: - reinstalling the extension - building and running the extension from source - hardcoding unstable in the extension source code - upgrading the deno executable
NDH
NDH16mo ago
What version of Deno are you running?
ts
deno -V
ts
deno -V
How were you able to modify the extension? Not a good idea IMHO
samme
samme16mo ago
deno --version deno 1.33.1 (release, aarch64-apple-darwin) v8 11.4.183.1 typescript 5.0.3
I just modified the source code while running the extension from source. I don't run it from source anymore
NDH
NDH16mo ago
Are you sure deno is enabled in the project, It is not enough to just have the /.vscode/settings.json , you must open the Command Pallet (Ctrl+Shift+P), and run the Deno: Initialize Workspace Configuration If it is initialized, you should see Deno 1.33.1 at the far right bottom status-bar in VSCode.
samme
samme16mo ago
NDH
NDH16mo ago
Can you run the code with deno run -A --unstable yourmodname.ts. ? Sometimes a successful run will refresh the cache. What is missing is lib.deno.unstable.d.ts
EthanThatOneKid
EthanThatOneKid16mo ago
GitHub
vscode errors: Deno.open, Deno.read, Deno.close: Property 'open' do...
Hi, Recently (as of today, after installing the latest deno version using Homebrew on my mac) Im getting errors in the "problems" tab. These are new and didn't get them before. The pr...
samme
samme16mo ago
^ Tried the versions he mention. No difference. Tried a few more versions. Also tried uninstalling deno completely, verified VSCode could not find the binary. Then reinstalled but through homebrew this time. Issue persists 🤷‍♂️ Runs fine with the flag, but the issue persists in the editor Where can I find this file and what populates it?
NDH
NDH16mo ago
It should have populated automatically with the deno: unstable = true setting.
samme
samme16mo ago
Populate where?
NDH
NDH16mo ago
In the cache. I think this is related https://github.com/denoland/deno/issues/18907
GitHub
vscode errors: Deno.open, Deno.read, Deno.close: Property 'open' do...
Hi, Recently (as of today, after installing the latest deno version using Homebrew on my mac) Im getting errors in the "problems" tab. These are new and didn't get them before. The pr...
samme
samme16mo ago
Where is the cache?
EthanThatOneKid
EthanThatOneKid16mo ago
Should we wait to roll forward?
samme
samme16mo ago
Does rolling back solve the issue for you? I have the issue in every version of Deno I try. Just tried 1.21.0 even Going to try different versions of the extension as well Nothing so far. Going to run deno from source and check the logs to see when/if the unstable flag gets lost
ioB
ioB16mo ago
It's quite strange, in one project I don't get this error and in another I do.
samme
samme16mo ago
🤦‍♂️ created a new directory with only an index.ts, did the init workspace config now it works
ioB
ioB16mo ago
weird, I’ll try that
samme
samme16mo ago
Found the culprit import { json, serve } from "https://deno.land/x/sift@0.6.0/mod.ts"; Commenting out this import solves the issue I suppose it overrides the .d.ts switched to import { serve } from "https://deno.land/std@0.185.0/http/server.ts"; instead.
EthanThatOneKid
EthanThatOneKid16mo ago
I cannot believe that simply removing the dependency I had on Sift actually fixed the problem! Thank you for looking into this for us!! I used code from the old Deno Deploy Discord Application Command tutorial which had Sift.
samme
samme16mo ago
same lol
EthanThatOneKid
EthanThatOneKid16mo ago
Deno.Kv + Discord Application Commands = ❤️
Hiro
Hiro15mo ago
This is still not fixed on latest Canary version, the LSP randomly doesnt recognize OpenKV...
Hiro
Hiro15mo ago
i was working with it without any problem all morning but now its gone
Hiro
Hiro15mo ago
Openned this issue for tracking https://github.com/denoland/deno/issues/19035
GitHub
Property 'openKv' does not exist on type 'typeof Deno'. VSCode · Is...
I am oppening this issue here since this has been recurrent on Discord, as of latest Canary build I am still unable to get the LSP to recognize the method on the Deno namespace. And of course, my V...
ioB
ioB15mo ago
yeah not really sure what’s going on here oh nice
More Posts