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
iOS/Android bundling unable to resolve vfile package exports #28411
Comments
Hi @isarni! Unfortunately, React Native / Metro support for ESM or package exports is limited and still in an unstable state. You can try and enable this for your project by configuring Metro with: // Learn more: https://docs.expo.dev/guides/customizing-metro/
const { getDefaultConfig } = require('expo/metro-config');
const config = getDefaultConfig(__dirname);
// Enable unstable package export support
// see: https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0534-metro-package-exports-support.md
config.resolver.unstable_enablePackageExports = true;
module.exports = config; It might work, but it could also cause other side-effects as it's still an experimental / unstable API. Hope this helps! |
Thanks for the reply, changing the configuration works for the example, but on our own app leads to a different error
|
Minimal reproducible example
https://github.com/lsarni/testvfile1
What platform(s) does this occur on?
Android, iOS
Did you reproduce this issue in a development build?
Yes
Summary
Affected platforms: ios and android
Current behaviour
The following error occurs when running
yarn ios
oryarn android
The bundling can't deal with this change on vfile added on version 6.0.0. There's this discussion about a similar problem on the vfile repo, but the problem itself is not on that package but on how expo bundles it.
Expected behaviour
If you remove
vfile
or use version^5.0.0
the bundling is successful, but we can't opt to use this dependency on our project as it's not a direct one. The bundling should be able to resolve "vfile/do-not-use-conditional-minpath" as it is declared on vfile@^6.0.0Environment
Expo Doctor Diagnostics
The text was updated successfully, but these errors were encountered: