-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fix React Native subpath imports #2133
Conversation
unstable_allowRequireContext: true, | ||
}, | ||
resolver: { | ||
unstable_enablePackageExports: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's added to the FAQ here: connectrpc/connectrpc.com#218
If that's too difficult to link to, can we add a comment that replicates the gist of it? E.g.
Connect-ES and Protobuf-ES use package exports. We need to enable support for them in Metro. See https://metrobundler.dev/docs/package-exports/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lmk if this is what you had in mind.
Signed-off-by: Steve Ayers <[email protected]>
Signed-off-by: Steve Ayers <[email protected]>
Signed-off-by: Steve Ayers <[email protected]>
Signed-off-by: Steve Ayers <[email protected]>
Signed-off-by: Steve Ayers <[email protected]>
Signed-off-by: Steve Ayers <[email protected]>
Signed-off-by: Steve Ayers <[email protected]>
81934b0
to
0f1dd47
Compare
Using the Metro bundler with React Native requires enabling package exports (docs) via a Metro config file. This adds said file and some necessary dependencies.
Note that we also spell this out in our Protobuf-ES docs.
It seems odd to have to use the
react-native-svg-transformer
here. But without it, we get asset errors. This combination here appears to be the right incantation to get things to work. Taken from this issue.