Skip to content

fix(deps): Add missing transitive peerDependencies#48616

Open
fbartho wants to merge 2 commits into
react:mainfrom
fbartho:ffb/react-native-missing-peerDepConstraints
Open

fix(deps): Add missing transitive peerDependencies#48616
fbartho wants to merge 2 commits into
react:mainfrom
fbartho:ffb/react-native-missing-peerDepConstraints

Conversation

@fbartho

@fbartho fbartho commented Jan 11, 2025

Copy link
Copy Markdown
Contributor

Summary

Fixes: #48615

Using yarn 3.6.4 (berry) on a new react-native project, I get the following dependency warnings:

$ yarn
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @react-native/babel-plugin-codegen@npm:0.76.6 doesn't provide @babel/preset-env (pda3fc), requested by @react-native/codegen
➤ YN0002: │ babel-plugin-transform-flow-enums@npm:0.0.2 doesn't provide @babel/core (pd2efd), requested by @babel/plugin-syntax-flow
➤ YN0002: │ react-native@npm:0.76.6 [24bb2] doesn't provide @babel/core (p230be), requested by babel-jest
➤ YN0002: │ react-native@npm:0.76.6 [24bb2] doesn't provide @babel/preset-env (pe8640), requested by @react-native/codegen
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code

Of these, it appears babel-plugin-transform-flow-enums isn't provided by this repository, but the rest of them are.

This PR bubbles up their peerDependency requirements into the appropriate package.json files

Changelog:

[GENERAL] [FIXED] - Peer dependency warnings for Yarn 3

Test Plan:

  1. Use yarn 3.6.4 (corepack enable)
  2. Create a new react-native project, and mark it as needing
  "packageManager": "yarn@3.6.4"
  1. yarn install
  2. Notice 3 out of 4 of the above warnings vanish.

Or use the reproducer: https://github.com/fbartho/react-native-peerDependencies-reproducer/

Fixes: react#48615

Using yarn 3.6.4 (berry) on a new react-native project, I get the following dependency warnings:
```shell
$ yarn
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @react-native/babel-plugin-codegen@npm:0.76.6 doesn't provide @babel/preset-env (pda3fc), requested by @react-native/codegen
➤ YN0002: │ babel-plugin-transform-flow-enums@npm:0.0.2 doesn't provide @babel/core (pd2efd), requested by @babel/plugin-syntax-flow
➤ YN0002: │ react-native@npm:0.76.6 [24bb2] doesn't provide @babel/core (p230be), requested by babel-jest
➤ YN0002: │ react-native@npm:0.76.6 [24bb2] doesn't provide @babel/preset-env (pe8640), requested by @react-native/codegen
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
```

Of these, it appears babel-plugin-transform-flow-enums isn't provided by this repository, but the rest of them are.

This commit bubbles up their peerDependency requirements into the appropriate package.json files
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Jan 11, 2025
@react-native-bot

Copy link
Copy Markdown
Collaborator

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@react-native-bot react-native-bot added Stale There has been a lack of activity on this issue and it may be closed soon. and removed Stale There has been a lack of activity on this issue and it may be closed soon. labels Jan 10, 2026
@fbartho

fbartho commented Jan 10, 2026

Copy link
Copy Markdown
Contributor Author

This PR was valid, I don’t know what to do to get it merged. I’m happy to update the branch if some maintainer offers to help get it merged, but if nobody with merge powers can help, I worry that’s a waste of limited time.

@react-native-bot

Copy link
Copy Markdown
Collaborator

This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@react-native-bot react-native-bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. Stale There has been a lack of activity on this issue and it may be closed soon.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warnings from react-native & @react-native/codegen about missing Peer Dependencies

3 participants