镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

commonjs module functionality is broken when project externally defined ambient require function #11752

Closed

Description

Reproduced on the latest master.

  • install typings for node npm install @types/node
  • create .js file with content
var fs = require("fs");
fs.
  • open file in VSCode and request completions after .

Expected: should see the content of fs module
Actual: completion list contains only identifiers in current file

Everything works as expected if I use import statement import * as fs from "fs"; instead of require.

Issue was introduces with this change since node declares ambient function require

Metadata

Metadata

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions