Skip to content

No commonjs module resolution when there is no jsconfig.json #7292

Closed

Description

@egamma

Extracted from microsoft/vscode#3509.

According to #6807 the default for module type is commonjs. However, in this example without a jsconfig.json then there are no completion proposals:

  • no jsconfig.json
  • add a file bar.js:
exports.foo = 3;
  • add app.js add the following:
var bar = require('./bar');
bar.

There a no completions on bar.

The work around is to add a jsconfig.json that defines the module type to commonjs:

jsconfig.json

{
    "compilerOptions": {
        "module": "commonjs"
    }
}

Activity

  1. billti commented on Mar 10, 2016

    @billti
    Member

    Pull request #7466 is out for this issue.

  2. added
    Fixed
    on Mar 10, 2016
  3. locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Fixed

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions