Skip to content

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

@egamma

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"
    }
}

Metadata

Metadata

Assignees

Labels

FixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions