diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index d5ce2bdc3a4..a1e52480172 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -3676,7 +3676,8 @@ namespace ts { // Do not do this in the global scope, as any variable we currently generate could conflict with // variables from outside of the current compilation. In the future, we can revisit this behavior. if (isExternalModule(currentSourceFile)) { - const tempVar = createTempVariable(recordTaggedTemplateString); + const tempVar = createUniqueName("templateObject"); + recordTaggedTemplateString(tempVar); templateArguments[0] = createLogicalOr( tempVar, createAssignment(