Closed brundonsmith closed 4 years ago
I'm having the same problem
I figured out how to get mine to work, I had to click the typescript version number down on the bottom right, click "Select Typescript Version" and then "Use VSCode's Version". Once I did that everything started working properly. Not sure how it got changed to use any other version but there you have it.
I tried @thezanke's suggestion. It seemed like I was already using VSCode's version; either way, it didn't solve the problem
I'm having the same issue. seems like the extension is simply not working, I'm developing in a devcontainer and it used to work fine with axetroy version. ๐คท๐ผโโ๏ธ
I can confirm, not working for minimal setup either. (Using VSCode builtin typescript 3.9.4)
Using the typescript-deno-plugin solves the issue for me fortunately. Couldn't debug enough this extension to find the cause of this :(
I did not have any issue with @axetroy version but this plugin doesn't work.
I have tried this but nothing has changed.
{
"deno.enable": true,
"editor.rulers": [80]
}
version 1.45
plugin version: 1.24.0
The new version of this extension was published to the Marketplace yesterday, but the update was not triggered by VS Code.
https://github.com/denoland/vscode_deno/pull/77
Completely uninstall your current version, close and open VS Code to make sure the cached version is deleted, and re-install. Now you have the update! The version number was not updated.
Does this fix it?
I just installed the extension for the first time about an hour ago and experiencing the same issue.
Similar to @bsunderhus, I installed typescript-deno-plugin
along with a workspace version of TypeScript v.3.9.5
. Changing back to VSCode version v3.8.3
essentially disables the extension.
Same here. I just installed this extension for the first today.
I just checked, and now with the update the wrongly checking .js
error is gone, but the extension is now is broken for me too.
It's the same for me, I'm also on MacOS, using VSCode TypeScript version and i've installed this plugin for the first time today (uninstalling the "deprecated" one just before). I already try to reload VSC, disable/enable the plugin, however it just doesn't work for me.
Okay, I ran into the issue again. What I had to do was:
$ npm install -g typescript@latest
and grab the path that it tells me it installed the bin files to, like "/Users/thezanke/.nvm/versions/node/v13.12.0/lib/node_modules/typescript/bin"
and use that in my vscode settings.json
like:
{
"typescript.tsdk": "/Users/thezanke/.nvm/versions/node/v13.12.0/lib/node_modules/typescript/lib"
}
(note that I switched /bin
to /lib
after /typescript
)
AND THEN I did what I mentioned earlier
click the typescript version number down on the bottom right, click "Select Typescript Version" and then "Use VSCode's Version".
make sure you click it even if it looks like it's already selected.
This fixed it for me again, I didn't think the settings.json had anything to do with it so I reverted it and on my next restart it stopped working.
Upgrade to latest typescript > 3.9.5
globally
Sadly, VScode still used typescript 3.8.3
In the global settings.json
file, force VScode to use the latest typescript.
"typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib/"
Now it's working as expected.
The extension doesn't do anything on macOS. No autocompletion. ๐
The extension doesn't do anything on macOS. No autocompletion. ๐
@melvin2016, I get autocompletion after everything was fixed as I desribed above. :)
FIX (macOS)
Upgrade to latest typescript > 3.9.5
globallySadly, VScode still used
typescript 3.8.3
In the
settings.json
file, force VScode to use the lastest typescript"typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib/"
Now its working as expected
Thanks, @elnobun It is working now!
Confirmed that @elnobun's fix worked for me
@elnobun's fix did not work for me unfortunately
@elnobun's fix did not work for me either. (Both Windows and Linux Remote)
FIX (macOS)
Upgrade to latest typescript > 3.9.5
globallySadly, VScode still used
typescript 3.8.3
In the
settings.json
file, force VScode to use the lastest typescript"typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib/"
Now its working as expected
It worked for me in Windows 10... for those who installed typescript globally with npm package use the "C:\Users\
you can find your location here...
It worked for me in Windows 10... for those who installed typescript globally with npm package use the "C:\Users
\AppData\Roaming\npm\node_modules\typescript\lib" location
@Mejanhaque , I think we all tried that. Are you sure you don't have a tsconfig.json that helps you out or other settings?
This setup does not work, as shown, with the denoland extension. (Windows 10)
It worked for me in Windows 10... for those who installed typescript globally with npm package use the "C:\Users\AppData\Roaming\npm\node_modules\typescript\lib" location
@Mejanhaque , I think we all tried that. Are you sure you don't have a tsconfig.json that helps you out or other settings?
This setup does not work, as shown, with the denoland extension. (Windows 10)
No need tsconfig..check the sc below:
So strange that the exact same thing only works for a few people. Maybe it doesn't work on VSCode 1.46.0, because that's what I'm using.
EDIT: Ok, figured out what we're doing differently. It doesn't work to force the library in the project settings.json
under .vscode
(Even though it let's you choose the library you put there), only in the global settings.json
.
@TTSKarlsson I've got VSCode 1.45.1 and your approach (global tsdk) works on my MacOS. Previous (workspace) solution didn't work for me.
FIX (macOS)
Upgrade to latest typescript > 3.9.5
globallySadly, VScode still used
typescript 3.8.3
In the
settings.json
file, force VScode to use the lastest typescript"typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib/"
Now its working as expected
For those that used nvm to install node, it might be handy to note that the right directory is actually a slightly different path! The path you'll be looking for on MacOS would be "/Users/\<username>/.nvm/versions/node/\<default node version>/lib/node_modules/typescript/lib/"
Hi Everyone,
I just want to write and say that we (Deno Land) haven't abandoned this extension module - we plan to work on these fixes - but as this is open source software, we just don't have the resources to address these problems immediately. We hope to dedicate some time to this extension next week after the Deno 1.1.0 release.
If you do have the time to dig into this, PRs are very welcome.
Ryan
For reference, if anyone is using DevContainers, I got the extension working by adding the extension to devcontainer.json
:
"extensions": ["denoland.vscode-deno"]
And then adding the full path to the lib directory in .vscode/settings.json
:
"typescript.tsdk": "/root/.vscode-server/extensions/denoland.vscode-deno-1.24.0/server/node_modules/typescript/lib"
The extension doesn't work at all. I recommend you guys to use the "deprecated" (which looks to be less deprecated than the official) version: https://marketplace.visualstudio.com/items?itemName=justjavac.vscode-deno&ssr=false
For reference, if anyone is using DevContainers, I got the extension working by adding the extension to
devcontainer.json
:"extensions": ["denoland.vscode-deno"]
And then adding the full path to the lib directory in
.vscode/settings.json
:"typescript.tsdk": "/root/.vscode-server/extensions/denoland.vscode-deno-1.24.0/server/node_modules/typescript/lib"
Using WSL2 and didn't work for me, still getting the same error.
I have the same issue on Ubuntu 20.04 LTS, while on Windows 10 everything works fine.
For those using WSL2.0, I got this plugin to work by globally installing the typescript-deno-plugin
npm package and updating my typescript version with npm install -g typescript@latest
My tsconfig.json
{
"compilerOptions": {
"plugins": [
{
"name": "typescript-deno-plugin",
"enable": true,
"importmap": "import_map.json"
}
]
}
}
And my settings.json
{
"deno.enable": true,
// this is the path to your globally installed typescript
"typescript.tsdk": "/home/scott/.npm-global/lib/node_modules/typescript/lib"
}
I also had to click on the typescript version at the bottom right and select use workspace version
Hope this helps someone because I spent way too much time trying to get this to work.
possibly fixed now
I have just updated to v1.25.0 and it seems to be working for me now. This is on Windows 10 VS code V1.46.0
macOS 13 High Sierra. Still broken.
Issue is back on Windows as well currently with vscode@1.47.3 and this plugin @ 1.25.0
VScode seems to be using this typescript version (3.9.6) -
But deno plugin seems to be using this (3.9.2) -
Not sure what the exact paths being used for both ts versions are.
Can I manually import Deno's lib, like import { Deno } from '...' ?
Did you enable the extension by adding "deno.enable": true
in the .vscode/settings.json
file? See https://github.com/denoland/vscode_deno#usage
Can I manually import Deno's lib, like import { Deno } from '...' ?
Yes, you can. but I don't think its working with vscode "import" snippets. But if you manually write like import {} from "htt.."
then the modules start to show up like the official gif plugin says. And also remember to enable deno in your project directory. I wrote an article about deno intellisense on vscode. You can check out the link below.
Yes, it correctly resolves imports like import * as Path from 'https://deno.land/std/path/mod.ts'; and Deno label is appeared in status bar
What version of Deno are you using? What OS are you on? What VS Code version? What extension version?
Also you need to sometimes restart all VS Code windows after adding the "deno.enable": true
setting before it will actually work.
Deno 1.3.2 Catalina 10.15.6 Code 1.48.2
I also have this setting globally "typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib",
Did you restart VS Code after enabling the setting in .vscode/settings.json
?
I solved it!
Setting in workspace file is not respected.
I added .vscode/settings.json { "deno.enable": true } to the root folder, where my *.ts files are actually located.
EDIT
Global settings are not respected also.
I wonder why this issue is closed. None of the workarounds described here succeeded for me on macOS Catalina with TypeScript 4.0.3.
@donaldoakes the causes of this issue simply cannot be causing the issue you are experiencing. The issues that let to the opening of this are resolved (which is why the issue was closed). Almost all of the work arounds listed here are for a very old version of the plugin and won't be useful with current versions.
If you are having issues with the extension, join the chat on Discord or open an issue with more details than this, like version of Visual Studio Code and the version of the extension installed.
This is how I made this work (VSCode 1.52.1).
Steps:
$ npm install -g typescript@latest
.vscode/settings.json
to the root:
{
"deno.enable": true,
"typescript.tsdk": "C:/Users/myuser/AppData/Roaming/npm/node_modules/typescript/lib"
}
Result:
p.s. This will not work if the .vscode/settings.json
is not in the root (e.g. in a subfolder next to *.ts
files).
WSL2 Ubuntu, Deno 1.7.5, VS Code 1.53.2, JavaScript and TypeScript Nightly 4.3.20210223
Hi guys, I was screening this thread after installing Deno and its VS Code extension for the first time. I tried all that was mentionned above, but nothing worked. I was about to give up until I tried to downgrade from the current version (3.0.1) to the version 2.3.3.
Then I ran into the problem of deno not found in the $PATH, that was solved in the issue #234 which proposed to create a symbolic link with:
I had the same issue. I resolved it with:
sudo ln -s /home/losintikfos/.deno/bin/deno /usr/bin
- Restart vscode.
And it worked! Then I tried to push my luck and updated The Deno extension again and everything finally worked.
Hope it could help someone.
I switched from one of the now-deprecated extensions, which was working, and this one isn't working properly. In fact, it seems to have all the same errors that you get with plain TypeScript and no Deno extension:
On the references to
Deno
it saysCannot find name 'Deno'.
.The extension is definitely active (I can see
Deno 1.0.5
in the corner) and I've restarted my editor, upgraded to the latest deno runtime, etc.Edit: In case it matters, I'm on macOS