wangyuzeW
Denoβ€’14mo agoβ€’
3 replies
wangyuze

How to resolve this issue: "Cannot find name 'Deno'.ts(2304)"?

Hello! I'm new to using Deno, currently on version 2.0.6.

I'm developing with VSCode and have installed the extension provided by Deno. I created a project using deno init deno_start. In VSCode, I ran Deno: Initialize Workspace Configuration and enabled Deno enable. Here is the content of
settings.json


{
  "deno.enable": true,
  "typescript.tsserver.experimental.enableProjectDiagnostics": false
}


But vscode keeps telling me that Deno cannot be found.

Introducing a /// <reference types="deno.ns" /> at the top of the file does not help. However, with cmd + click, I can always jump to Deno's type definition files.

I've been searching online for a long time. On GitHub and Discord, a few people encountered the same problem, and they solved it by setting "typescript.tsserver.experimental.enableProjectDiagnostics" to
false
. However, this didn't work for me. I've already added this setting in
settings.json
.

Is there any way to solve this issue? Thanks a lot.
2024-11-13_15.05.52.png
2024-11-13_15.07.13.png
2024-11-13_15.14.23.png
Was this page helpful?