Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vscode_deno shows errors when working with typescript files in node #39

Closed
trentjones21 opened this issue May 17, 2020 · 5 comments
Closed
Labels
bug Something isn't working

Comments

@trentjones21
Copy link

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.

@egoist
Copy link

egoist commented May 17, 2020

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.

@justjavac
Copy link
Contributor

justjavac commented May 18, 2020

@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/**/*"]
}

@egoist
Copy link

egoist commented May 18, 2020

@justjavac awesome, that's exactly what I want 👏

@lucacasonato
Copy link
Member

lucacasonato commented Feb 19, 2021

Extension is disabled by default now. For other node compat issues refer to #314

@danger-ahead
Copy link

deno.include and deno.exclude seems to be outdated.

This works for me:

{
   "deno.enable": true,
   "deno.enablePaths": ["supabase/functions/"],
}

deno.enable enables it for the full workspace.
Whereas if you enable deno.enablePaths, deno.enable is ignored and only enables deno in the selected paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants