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

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

Closed
vladima opened this issue Oct 20, 2016 · 0 comments · Fixed by #11819
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@vladima
Copy link
Contributor

vladima commented Oct 20, 2016

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

@vladima vladima added the Bug A bug in TypeScript label Oct 20, 2016
@vladima vladima added this to the TypeScript 2.1 milestone Oct 20, 2016
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Oct 24, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants