Skip to content

module.exports assignment in a JavaScript file cannot be imported with ES6 syntax #7076

@billti

Description

@billti

See commented out failing test in this pull request.

I've spent a while in the debugger on this, and the root cause appears to be how the export= SymbolObject is constructed in the source file's symbol.exports property in a JavaScript module source file versus a TypeScript module source file. This causes resolveESModuleSymbol to return undefined.

Being it applies only to this specific construct (i.e. assignments to exports. work with es6 imports, or importing with var <id> = require(...) syntax works), its not a total blocker. But would be good to fix ASAP, especially as the error is rather unattractive.

screen shot 2016-02-13 at 5 32 44 pm

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