vscode_deno shows errors when working with typescript files in node

Created on 17 May 2020  路  4Comments  路  Source: denoland/vscode_deno

After installing vscode_deno, all of my node typescript files had errors like

import express from "express"; // cannot find module 'express'

Even though express was installed and in my node_modules folder. Uninstalling vscode_deno fixes the problem.

bug

Most helpful comment

@egoist Deno and Node.js are too different, there is no very good way to support both.

But we are also trying some way, such as:

vs code config for extension

{
    "deno.include": ["src/deno/**/*"],
    "deno.exclude": ["node_modules", "**/*.spec.ts"]
}

tsconfig for typescript-deno-plugin

{
  "compilerOptions": {
    "plugins": [
      {
        "name": "typescript-deno-plugin",
        "include": ["src/deno/**/*"],
        "exclude": ["node_modules", "**/*.spec.ts"]
      }
    ]
  },
  "include": ["src/node/**/*"]
}

All 4 comments

Is there a way to manually enable/disable this extension for a directory/file? A lot of people would like to use Deno in an existing Node.js/webpack project.

@egoist Deno and Node.js are too different, there is no very good way to support both.

But we are also trying some way, such as:

vs code config for extension

{
    "deno.include": ["src/deno/**/*"],
    "deno.exclude": ["node_modules", "**/*.spec.ts"]
}

tsconfig for typescript-deno-plugin

{
  "compilerOptions": {
    "plugins": [
      {
        "name": "typescript-deno-plugin",
        "include": ["src/deno/**/*"],
        "exclude": ["node_modules", "**/*.spec.ts"]
      }
    ]
  },
  "include": ["src/node/**/*"]
}

@justjavac awesome, that's exactly what I want 馃憦

Extension is disabled by default now. For other node compat issues refer to https://github.com/denoland/vscode_deno/issues/314

Was this page helpful?
0 / 5 - 0 ratings