Skip to content

Commit 09a87b9

Browse files
'amd' missing from error message for error TS1323 (#33803)
'amd' missing from error message for error TS1323
2 parents afe6f4c + d9d3e31 commit 09a87b9

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35976,7 +35976,7 @@ namespace ts {
3597635976

3597735977
function checkGrammarImportCallExpression(node: ImportCall): boolean {
3597835978
if (moduleKind === ModuleKind.ES2015) {
35979-
return grammarErrorOnNode(node, Diagnostics.Dynamic_import_is_only_supported_when_module_flag_is_commonjs_or_esNext);
35979+
return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_esnext_commonjs_amd_system_or_umd);
3598035980
}
3598135981

3598235982
if (node.typeArguments) {

src/compiler/diagnosticMessages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@
903903
"category": "Error",
904904
"code": 1322
905905
},
906-
"Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'.": {
906+
"Dynamic imports are only supported when the '--module' flag is set to 'esnext', 'commonjs', 'amd', 'system', or 'umd'.": {
907907
"category": "Error",
908908
"code": 1323
909909
},
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
tests/cases/conformance/dynamicImport/1.ts(1,1): error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'.
2-
tests/cases/conformance/dynamicImport/1.ts(2,10): error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'.
3-
tests/cases/conformance/dynamicImport/1.ts(8,16): error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'.
1+
tests/cases/conformance/dynamicImport/1.ts(1,1): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'esnext', 'commonjs', 'amd', 'system', or 'umd'.
2+
tests/cases/conformance/dynamicImport/1.ts(2,10): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'esnext', 'commonjs', 'amd', 'system', or 'umd'.
3+
tests/cases/conformance/dynamicImport/1.ts(8,16): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'esnext', 'commonjs', 'amd', 'system', or 'umd'.
44

55

66
==== tests/cases/conformance/dynamicImport/0.ts (0 errors) ====
@@ -9,16 +9,16 @@ tests/cases/conformance/dynamicImport/1.ts(8,16): error TS1323: Dynamic import i
99
==== tests/cases/conformance/dynamicImport/1.ts (3 errors) ====
1010
import("./0");
1111
~~~~~~~~~~~~~
12-
!!! error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'.
12+
!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'esnext', 'commonjs', 'amd', 'system', or 'umd'.
1313
var p1 = import("./0");
1414
~~~~~~~~~~~~~
15-
!!! error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'.
15+
!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'esnext', 'commonjs', 'amd', 'system', or 'umd'.
1616
p1.then(zero => {
1717
return zero.foo();
1818
})
1919

2020
function foo() {
2121
const p2 = import("./0");
2222
~~~~~~~~~~~~~
23-
!!! error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'.
23+
!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'esnext', 'commonjs', 'amd', 'system', or 'umd'.
2424
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
tests/cases/conformance/dynamicImport/index.ts(2,18): error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'.
2-
tests/cases/conformance/dynamicImport/index.ts(2,32): error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'.
1+
tests/cases/conformance/dynamicImport/index.ts(2,18): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'esnext', 'commonjs', 'amd', 'system', or 'umd'.
2+
tests/cases/conformance/dynamicImport/index.ts(2,32): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'esnext', 'commonjs', 'amd', 'system', or 'umd'.
33

44

55
==== tests/cases/conformance/dynamicImport/foo.ts (0 errors) ====
@@ -9,7 +9,7 @@ tests/cases/conformance/dynamicImport/index.ts(2,32): error TS1323: Dynamic impo
99
async function foo() {
1010
return await import((await import("./foo")).default);
1111
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12-
!!! error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'.
12+
!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'esnext', 'commonjs', 'amd', 'system', or 'umd'.
1313
~~~~~~~~~~~~~~~
14-
!!! error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'.
14+
!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'esnext', 'commonjs', 'amd', 'system', or 'umd'.
1515
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
tests/cases/conformance/dynamicImport/index.ts(2,18): error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'.
2-
tests/cases/conformance/dynamicImport/index.ts(2,32): error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'.
1+
tests/cases/conformance/dynamicImport/index.ts(2,18): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'esnext', 'commonjs', 'amd', 'system', or 'umd'.
2+
tests/cases/conformance/dynamicImport/index.ts(2,32): error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'esnext', 'commonjs', 'amd', 'system', or 'umd'.
33

44

55
==== tests/cases/conformance/dynamicImport/foo.ts (0 errors) ====
@@ -9,7 +9,7 @@ tests/cases/conformance/dynamicImport/index.ts(2,32): error TS1323: Dynamic impo
99
async function foo() {
1010
return await import((await import("./foo")).default);
1111
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12-
!!! error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'.
12+
!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'esnext', 'commonjs', 'amd', 'system', or 'umd'.
1313
~~~~~~~~~~~~~~~
14-
!!! error TS1323: Dynamic import is only supported when '--module' flag is 'commonjs' or 'esNext'.
14+
!!! error TS1323: Dynamic imports are only supported when the '--module' flag is set to 'esnext', 'commonjs', 'amd', 'system', or 'umd'.
1515
}

0 commit comments

Comments
 (0)