How can I avoid the "an import path cannot end with .ts extension" error in VSCode? How can I avoid the "an import path cannot end with .ts extension" error in VSCode? typescript typescript

How can I avoid the "an import path cannot end with .ts extension" error in VSCode?


This can be solved by installing and configuring the Deno Extensions for VSCode.

Press CtrlShiftX to open the extensions view,then type "deno" and click on the entry name "Deno - Deno support for VSCode":

enter image description here

and install it.

After installation, you can either

  • go to the global settings (Ctrl,), select "Extensions" and then "Deno" and click on the checkbox under "Deno:Enable".

    enter image description here

  • or, the recommended way, add a local setting in your project:

    create a folder named .vscode in your project folder and add a file settings.json and add the following lines:

    {  "deno.enable": true,}

In both cases, after restarting Visual Studio Code, the error should be gone.