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

React Native / Metro bundler shows warning and ignores package due to change in rules about package.json's exports section #3257

Closed
cabiad opened this issue Oct 24, 2020 · 1 comment
Labels
react-native React Native issue

Comments

@cabiad
Copy link
Contributor

cabiad commented Oct 24, 2020

Describe the bug
React native's metro bundler ignores react-hook-form and shows a warning.

Similar issues have been reported in many other projects as listed in this react native cli issue and the fix used by those projects is quite simple and seemingly low risk.

To Reproduce
Steps to reproduce the behavior:

With node 15.0.1 and yarn 1.22.10 installed (as of this writing, the latest available in homebrew)...

  1. Create a new react native app with npx react-native init DummyProj
  2. cd DummyProj/
  3. Install react-hook-form with yarn add react-hook-form
  4. Start the metro bundler with yarn start
  5. Observe the following error output:
$ yarn start
yarn run v1.22.10
$ react-native start
warn Package react-hook-form has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/cabiad/src/DummyProj/node_modules/react-hook-form/package.json

Codesandbox link (Required)
(Not applicable for this build issue.)

Expected behavior
The package is not ignored in react native

Desktop (please complete the following information):

  • OS: MacOS
  • Browser N/A
  • Version 6.9.6

Additional context
Add any other context about the problem here.

@bluebill1049
Copy link
Member

Thanks heap for report the issue and provide a solution 🙏

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
react-native React Native issue
Projects
None yet
Development

No branches or pull requests

2 participants