diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 2cc48c02947..b038a699b47 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -1418,7 +1418,7 @@ namespace ts { else { const parent = node.parent as SourceFile; - if (!isExternalModule(node.parent)) { + if (!isExternalModule(parent)) { file.bindDiagnostics.push(createDiagnosticForNode(node, Diagnostics.Global_module_exports_may_only_appear_in_module_files)); return; }