Skip to content

Cannot read property 'externalModuleIndicator' of undefined error occurred when trying to compile  #15725

@aiiak

Description

@aiiak

TypeScript Version: 2.3.2
Getting following error when trying to compile my solution with typescript 2.3.2

TypeError: Cannot read property 'externalModuleIndicator' of undefined
    at isBlockScopedNameDeclaredBeforeUse (C:\Users\Alexander.Yakovlev\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:21253:87)
    at checkResolvedBlockScopedVariable (C:\Users\Alexander.Yakovlev\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:21613:57)
    at resolveName (C:\Users\Alexander.Yakovlev\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:21502:25)
    at getGlobalSymbol (C:\Users\Alexander.Yakovlev\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:26100:20)
    at getGlobalValueSymbol (C:\Users\Alexander.Yakovlev\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:26094:20)
    at getGlobalPromiseConstructorSymbol (C:\Users\Alexander.Yakovlev\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:26122:104)
    at createPromiseReturnType (C:\Users\Alexander.Yakovlev\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:32996:23)
    at getReturnTypeFromBody (C:\Users\Alexander.Yakovlev\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:33037:31)
    at getReturnTypeOfSignature (C:\Users\Alexander.Yakovlev\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:25737:28)
    at checkCallExpression (C:\Users\Alexander.Yakovlev\AppData\Roaming\npm\node_modules\typescript\lib\tsc.js:32837:20)

Doesn't have any problems with [email protected]

It looks like somehow caused by Promise< T > implementation along with compilerOptions.target = "es5". If we remove Promise from solution, error, that i provided above didn't occurred, and we got

error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions