VSCode Extension Failing ot Initialize
:party_deno: RESOLVED :party_deno:
Having a bit of trouble using the VSCode Extension.
deno
does seem to be a recognized CLI, even within the terminal inside VSCode. I have tried uninstalling and reinstalling the extension multiple times as well as ensuring VSCode is up to date and full restarting VSCode.
If I attempt to run any of the command palette
commands
I get a variation of an error as shown in the 3rd attached (partial) screenshot.
Trying to resolve what is wrong here. My wild guess here is the extension can't resolve deno
CLI
for some reason? Can't seem to resolve that either 🤔
Any help would be appreciated! I'm guessing it is obvious and a fresh pair eyes will quickly resolve what I'm overlooking.3 Replies
It sounds like you're experiencing issues with the Deno extension in VSCode not recognizing the Deno CLI. Here are a few steps you can take to troubleshoot this issue, based on the documentation:
1. Check Deno Installation: First, ensure that Deno is installed correctly on your system. You can do this by running
deno --version
in your terminal outside of VSCode. If Deno is not recognized, you'll need to install it or fix your system's PATH environment variable to include the Deno binary.
2. Setting a Path to the Deno CLI: If Deno is installed and working outside of VSCode, but the extension can't find it, you might need to set the path to the Deno executable manually. The documentation mentions that you can set the Deno: Path
setting in VSCode to point to the Deno executable. If the path provided is relative, it will be resolved relative to the root of the workspace.
3. Initialize Workspace Configuration: Use the Deno: Initialize Workspace Configuration
command from the VSCode command palette. This will set up the necessary settings in your workspace's .vscode/settings.json
file, such as enabling Deno, linting, and unstable APIs if desired.
4. Check Workspace Settings: Make sure that the workspace settings have Deno enabled. You can find this setting under Deno: Enable
in the VSCode settings UI or deno.enable
in the settings JSON file.
5. Restart VSCode: Sometimes, simply restarting VSCode can resolve issues with extensions not functioning correctly.
6. Check for Errors/Diagnostics: If you're seeing errors like An import path cannot end with a '.ts' extension
or Cannot find name 'Deno'
, it could indicate that Deno is not enabled for your project. Ensure that the Deno: Enable
setting isDeno
Deno, the next-generation JavaScript runtime
Deno features improved security, performance, and developer experience compared to its predecessor. It's a great time to upgrade your Node.js project to run on Deno.
set to
true
.
7. Disable Conflicting Settings: The documentation also suggests checking if the VSCode configuration called enableProjectDiagnostics
, located in TypeScript › Tsserver › Experimental: Enable Project Diagnostics
, is disabled. This setting can interfere with Deno's language server if left enabled.
If after following these steps the issue persists, it might be a bug that the Deno team hasn't encountered yet. In that case, searching the issues on the vscode_deno GitHub repository and reporting a new bug with detailed information about your setup and the errors you're encountering would be the next step.
Remember, the Deno community is also a great resource, so don't hesitate to ask for help in the Deno Discord if you continue to face challenges. 🦕RESOLVED
:party_deno:
For me, I ended up reinstalling Deno via a different method.
The first time I had used the first option listed in the docs:
The 2nd time I used Homebrew
:
Then subsequently rebooted VSCode
and it seems to work now!