-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Stop checking existing resolution now that we have concept of package ID #58528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,4 @@ | ||
| /node_modules/bar/index.d.ts(1,23): error 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. | ||
| The file is in the program because: | ||
| Type library referenced via 'alpha' from file '/node_modules/foo/index.d.ts' | ||
| Type library referenced via 'alpha' from file '/node_modules/bar/index.d.ts' | ||
| /node_modules/bar/node_modules/alpha/index.d.ts(1,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'alpha' must be of type 'any', but here has type '{}'. | ||
|
|
||
|
|
||
| ==== /src/root.ts (0 errors) ==== | ||
|
|
@@ -15,16 +12,13 @@ | |
| ==== /node_modules/foo/node_modules/alpha/index.d.ts (0 errors) ==== | ||
| declare var alpha: any; | ||
|
|
||
| ==== /node_modules/bar/index.d.ts (1 errors) ==== | ||
| ==== /node_modules/bar/index.d.ts (0 errors) ==== | ||
| /// <reference types="alpha" /> | ||
| ~~~~~ | ||
| !!! error 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. | ||
| !!! error TS4090: The file is in the program because: | ||
| !!! error TS4090: Type library referenced via 'alpha' from file '/node_modules/foo/index.d.ts' | ||
| !!! error TS4090: Type library referenced via 'alpha' from file '/node_modules/bar/index.d.ts' | ||
| !!! related TS1404 /node_modules/foo/index.d.ts:1:23: File is included via type library reference here. | ||
| declare var bar: any; | ||
|
|
||
| ==== /node_modules/bar/node_modules/alpha/index.d.ts (0 errors) ==== | ||
| ==== /node_modules/bar/node_modules/alpha/index.d.ts (1 errors) ==== | ||
| declare var alpha: {}; | ||
| ~~~~~ | ||
| !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'alpha' must be of type 'any', but here has type '{}'. | ||
| !!! related TS6203 /node_modules/foo/node_modules/alpha/index.d.ts:1:13: 'alpha' was also declared here. | ||
|
Comment on lines
+19
to
+23
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was going to say "the old message seemed useful because it said where the dupe was", but I guess this related line would be enough. Though it's moderately a shame to lose a message that gives a potential solution.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The things work much better where you could have two typings that dont add to global and used by two packages and hence two different versions. This handles that well. We have this issue with module resolution. The only message we gave was with typeRef and it wasnt correct checking either so i feel better removing this custom logic for typeRef only and allows packages to use typeRef of different versions if they dont add conflicting global info. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These didnt have package.json so didnt get deduped. But I added test case 4b and 5b where there is package.json