Skip to content
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

@types/react-dom dependency to @types/react causes version mismatch with @types/react #20005

Closed
tomaszs opened this issue Oct 13, 2020 · 2 comments

Comments

@tomaszs
Copy link

tomaszs commented Oct 13, 2020

According to this post https://stackoverflow.com/a/52422489/38940 and validated by me:

"devDependencies": {
  "@types/react": "^15.0.16",
  "@types/react-dom": "^0.14.23"
  ...
}

resolve to different versions of @types/react:

"@types/react-dom@^0.14.23":
  version "0.14.23"
  resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-0.14.23.tgz#cecfcfad754b4c2765fe5d29b81b301889ad6c2e"
  dependencies:
    "@types/react" "*"

"@types/react@*":
  version "16.4.14"
  resolved "https://registry.yarnpkg.com/@types/react/-/react-16.4.14.tgz#47c604c8e46ed674bbdf4aabf82b34b9041c6a04"
  dependencies:
    "@types/prop-types" "*"
    csstype "^2.2.0"

"@types/react@^15.0.16":
  version "15.6.19"
  resolved "https://registry.yarnpkg.com/@types/react/-/react-15.6.19.tgz#a5de18afe65b0f29767328836b48c498a5d3a91b"

```

react-dom expects latest @types/react, while @types/react can be installed in other version. Since both versions are downloaded, there are conflicts between these versions. Maybe @types/react-dom should expect specific version of @types/react to solve this problem
@tomaszs tomaszs added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Oct 13, 2020
@tomaszs tomaszs changed the title Bug: @types/react-dom dependency to @types/react causes version mismatch with @types/react Oct 13, 2020
@kachkaev
Copy link

Hi @tomaszs! This repo does not contain TypeScript Typings, they originate from https://github.com/DefinitelyTyped/DefinitelyTyped

Either way, your problem is in the user land. Instead of

"devDependencies": {
  "@types/react": "^x.x.x",
  "@types/react-dom": "^y.y.y"
  ...
}

it should always be

"devDependencies": {
  "@types/react": "^x.x.x",
  "@types/react-dom": "^x.x.x"
  ...
}

@eps1lon
Copy link
Collaborator

eps1lon commented Oct 13, 2020

Delete all lockfile entries for @types/react and run yarn again. This should result in a single version.

The types are hosted in a different repository. In the future please open type related issues in the https://github.com/DefinitelyTyped/DefinitelyTyped repository.

@eps1lon eps1lon closed this as completed Oct 13, 2020
@eps1lon eps1lon added Resolution: Support Redirect and removed Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug labels Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants