Open tjzel opened 1 month ago
@tido64 / @acoates-ms any opinions here?
Sorry, I'm a bit confused. Where does this override happen in react-native-macos
? I've tried looking at the code but the only place I found that even sets resolver
is in @react-native/community-cli-plugin
. Furthermore, I'm pretty sure we use resolveRequest
ourselves internally to support symlinks and other scenarios.
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.