Skip to content

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

Closed
@vladima

Description

@vladima

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

Assignees

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