Skip to content

Commit a36e155

Browse files
committed
Update error message for conflicting type definitions
Fixes microsoft#10370
1 parent f7f5007 commit a36e155

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/compiler/diagnosticMessages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2231,7 +2231,7 @@
22312231
"category": "Error",
22322232
"code": 4082
22332233
},
2234-
"Conflicting library definitions for '{0}' found at '{1}' and '{2}'. Copy the correct file to the 'typings' folder to resolve this conflict.": {
2234+
"Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict.": {
22352235
"category": "Message",
22362236
"code": 4090
22372237
},

src/compiler/program.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2048,7 +2048,7 @@ namespace ts {
20482048
const otherFileText = host.readFile(resolvedTypeReferenceDirective.resolvedFileName);
20492049
if (otherFileText !== getSourceFile(previousResolution.resolvedFileName).text) {
20502050
fileProcessingDiagnostics.add(createDiagnostic(refFile, refPos, refEnd,
2051-
Diagnostics.Conflicting_library_definitions_for_0_found_at_1_and_2_Copy_the_correct_file_to_the_typings_folder_to_resolve_this_conflict,
2051+
Diagnostics.Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict,
20522052
typeReferenceDirective,
20532053
resolvedTypeReferenceDirective.resolvedFileName,
20542054
previousResolution.resolvedFileName

tests/baselines/reference/library-reference-5.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/node_modules/bar/index.d.ts(1,1): message TS4090: Conflicting library definitions for 'alpha' found at '/node_modules/bar/node_modules/alpha/index.d.ts' and '/node_modules/foo/node_modules/alpha/index.d.ts'. Copy the correct file to the 'typings' folder to resolve this conflict.
1+
/node_modules/bar/index.d.ts(1,1): message TS4090: Conflicting definitions for 'alpha' found at '/node_modules/bar/node_modules/alpha/index.d.ts' and '/node_modules/foo/node_modules/alpha/index.d.ts'. Consider installing a specific version of this library to resolve the conflict.
22

33

44
==== /src/root.ts (0 errors) ====
@@ -18,7 +18,7 @@
1818
==== /node_modules/bar/index.d.ts (1 errors) ====
1919
/// <reference types="alpha" />
2020
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21-
!!! message TS4090: Conflicting library definitions for 'alpha' found at '/node_modules/bar/node_modules/alpha/index.d.ts' and '/node_modules/foo/node_modules/alpha/index.d.ts'. Copy the correct file to the 'typings' folder to resolve this conflict.
21+
!!! message TS4090: Conflicting definitions for 'alpha' found at '/node_modules/bar/node_modules/alpha/index.d.ts' and '/node_modules/foo/node_modules/alpha/index.d.ts'. Consider installing a specific version of this library to resolve the conflict.
2222
declare var bar: any;
2323

2424
==== /node_modules/bar/node_modules/alpha/index.d.ts (0 errors) ====

0 commit comments

Comments
 (0)