:enomem
:enomem14mo ago

Deno Language Server Issue - Attempting to Use KV in Existing Project

Hi! I'm attempting to create a branch of an existing project (utilizing Fresh) and add KV as an experiment. I also just want to establish I do have the latest version of Deno installed and have updated VSCode/the Deno extension. While getting things set up, I updated my vscode folder in the project directory and also made sure to update deno.json to use the unstable flag. Upon trying to add a new file that utilized KV, I noticed I kept getting errors upon typing anything related to the new KV API. I suspected there was something off with the Language server, but upon inspection it seemed to recognize the unstable flag just fine. I decided to quickly fork the tic-tac-toe project referenced in the KV documentation to compare and contrast - it all works fine, even offering up tooltips mentioning that KV is unstable and how to use it. I compared Deno Language Server Status between the two projects, but could not spot a difference. The vscode directories in each project are basically identical. Before I waste too much time chasing a dead-end or giving up and ignoring that file, does anyone have any advice or context? I fear I'm just missing something really silly, but for the life of me I can't figure it out. I've slept on it one night, so I'm fairly certain it's not just foggy brain. Thanks in advance to anyone who can help! In case I forgot anything, I'm more than happy to fill in any missing pieces or context!
1 Reply
:enomem
:enomem14mo ago
Fixed it: I had to update my main.ts entry point with the following:
// <reference lib="deno.unstable" />
// <reference lib="deno.unstable" />