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

exports in package.jsons need to be updated to work with Metro. #477

Open
samwightt opened this issue Sep 8, 2024 · 1 comment
Open

Comments

@samwightt
Copy link
Contributor

Metro is the bundler for React Native. It has experimental support for the exports field in package.json, however I have had issues getting it to work with some of Evolu's packages. Things that need to change:

  • Any conditional exports that use browser need to be default instead. Node recommends using default instead of browser here: https://nodejs.org/docs/latest-v19.x/api/packages.html#conditional-exports
    • Other alternative is to add a default conditional export with the same value as browser.
  • Documentation needs to be updated to instruct users on how to enable experimental exports support in Metro:
    • If a user is using Expo, they need to follow these instructions to create their metro.config.js file.
    • Users will then need to add config.resolver.unstable_enablePackageExports = true; to their metro.config.js file.

This should fix errors users get where Metro cannot find Evolu's modules.

@steida
Copy link
Contributor

steida commented Sep 9, 2024

I will review it after the new sync and update docs. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants