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

Yarn creates duplicate dependency resolution with @tonic-ui/react and @tonic-ui/react-lab when using exact versions #642

Closed
cheton opened this issue Nov 15, 2022 · 1 comment
Labels
❌ wontfix This will not be worked on

Comments

@cheton
Copy link
Member

cheton commented Nov 15, 2022

From this commit, you can find that @tonic-ui/[email protected] depends on @tonic-ui/react@^1.7.2

https://github.com/trendmicro-frontend/tonic-ui/blob/b76bdc88fb74a9d2f76f701fd830c0910f1473bc/packages/react-lab/package.json

{
  "name": "@tonic-ui/react-lab",
  "version": "0.5.2",
  "dependencies": {
    "@tonic-ui/react": "^1.7.2",
    "@tonic-ui/react-hooks": "^1.4.1",
    "@tonic-ui/utils": "^1.1.2",
    "date-fns": "2.x",
    "ensure-type": "^1.5.1",
    "micro-memoize": "4.x"
  }
}

However, it may cause unexpected results when using exact versions with Yarn.

Use exact version to match dependencies

package.json

{
  "name": "my-app",
  "version": "0.1.0",
  "dependencies": {
    "@tonic-ui/react": "1.7.2",
    "@tonic-ui/react-lab": "0.5.2"
  }
}

yarn install will produce the following results with exact versions

node_modules/@tonic-ui/react-hooks
node_modules/@tonic-ui/utils
node_modules/@tonic-ui/theme
node_modules/@tonic-ui/react // -> 1.7.2
node_modules/@tonic-ui/react/node_modules/react-is
node_modules/@tonic-ui/styled-system
node_modules/@tonic-ui/react-lab // -> 0.5.2
node_modules/@tonic-ui/react-lab/node_modules/react-is
node_modules/@tonic-ui/react-lab/node_modules/@tonic-ui/react // -> 1.8.0 (duplicate)

Use ^version to match dependencies

package.json

{
  "name": "my-app",
  "version": "0.1.0",
  "dependencies": {
    "@tonic-ui/react": "^1.7.2",
    "@tonic-ui/react-lab": "^0.5.2"
  }
}

yarn install will produce the following results:

node_modules/@tonic-ui/react-hooks
node_modules/@tonic-ui/utils
node_modules/@tonic-ui/theme
node_modules/@tonic-ui/react // -> 1.7.2
node_modules/@tonic-ui/react/node_modules/react-is
node_modules/@tonic-ui/styled-system
node_modules/@tonic-ui/react-lab // -> 0.5.2
@cheton cheton pinned this issue Nov 15, 2022
@cheton cheton changed the title Yarn creates duplicate dependency resolution with @tonic-ui/react and @tonic-ui/react-lab with exact versions Yarn creates duplicate dependency resolution with @tonic-ui/react and @tonic-ui/react-lab when using exact versions Nov 16, 2022
@cheton cheton added the ❌ wontfix This will not be worked on label Nov 16, 2022
@cheton
Copy link
Member Author

cheton commented Jun 23, 2023

Moved to Commly Asked Questions

@cheton cheton closed this as completed Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❌ wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant