React Native Macos overrides resolveRequest
property of resolver
in Metro config
#2123
Labels
resolveRequest
property of resolver
in Metro config
#2123
Environment
Steps to reproduce the bug
When dealing with more complicated project configurations, namely monorepos, Metro has to be configured to prevent all sort of issues, like duplicated modules, correct resolving etc.
You can see an example of such setup in react-native-screens repo.
React Native Reanimated tries to actively support macOS. However, we are currently in the process of a migration to a monorepo setup and I noticed that
resolveRequest
function gets overridden byreact-native-macos
. This might cause the Metro bundler to fail or to duplicate some modules.As a simple reproduction, you can create an App using
react-native-macos
and paste this into yourmetro.config.js
:You will notice that nothing ever gets logged and module resolution doesn't fail, although it should.
Expected Behavior
User provided
requestResolve
function is acknowledged and used.Actual Behavior
User provided
requestResolve
is not used.Reproducible Demo
No response
Additional context
I understand that you might have the need of having your own custom
resolveRequest
function. However, this should not completely override the user's function.For now we can solve the issue in our repository by patch-package. I'd be grateful if you could point me to the place in your code where you override the
requestResolve
function so we can properly embedreact-native-macos
in our new monorepo setup.The text was updated successfully, but these errors were encountered: