vscode_deno: Why vs code doesn't show types for Deno
I’ve installed this plugin, but when I try to write code, for example:
console.log(Deno.readDirSync("."));
vs code shows me an error: Cannot find name ‘Deno’.ts(2304) I use built-in version of TypeScript. Do I need to download types somehow?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 19
Commits related to this issue
- Fix broken installation of TS definition files for `Deno`. Fix wrong VS Code Extension ID. Explicitly `await` (and catch) `deno.generateDtsForDeno`, so all definition files are in place, before the e... — committed to denisbrodbeck/vscode_deno by denisbrodbeck 4 years ago
- Fix broken installation of TS definition files for `Deno`. (#77) Fix wrong VS Code Extension ID. Explicitly `await` (and catch) `deno.generateDtsForDeno`, so all definition files are in place, befor... — committed to denoland/vscode_deno by denisbrodbeck 4 years ago
Perhaps
init deno
will solve the problem: Invscode
“show all commands” via CMD/CTRL + SHIFT + P and search forinit deno
, run it. Helped me to solve all problems with shown errors in vscode with deno.Hi @buttercubz , @filburt-turle finally, it’s working for me. I downloaded lib.deno.d.ts file, then I restarted the typescript server, restarted mac and it worked! Thanks for the tips 😃
@jbergant as temporary fix you can try to copy lib.deno.d.ts and lib.webworker.d.ts from ~/.vscode/extensions/denoland.vscode-deno-1.24.0/node_modules/typescript-deno-plugin/lib to $HOME/Library/Caches/deno as I mentioned before, but I’m not sure about Mac OS paths you can try. It worked for me on Windows
Fixed by copying lib.deno.d.ts and lib.webworker.d.ts from
to
Seems like extention wasn’t able to copy it’s dts files don’t know why.
This worked for me. Cheers!