Open Bob-FE opened 7 months ago
Would love a response on this. Upgrading to RN 0.75 and we had to move all our dynamic imports back to normal imports to get it working.
Hi folks - has anyone experienced this in iOS? I'm looking into it now and it appears to be an Android-specific issue with URLs getting mangled.
The change that triggered this is most likely https://github.com/facebook/react-native/pull/37003 (RN 0.73.0), which causes await import()
to become a bundle-splitting boundary, with the separate piece being loaded in a separate HTTP request to Metro.
In monorepos, the path may begin ../<something>.bundle
, and it looks like Android is dropping the ../
.
(I should add that the repro uses babel-plugin-module-resolver
, which we don't recommend/support and may cause issues on both iOS and Android, but the issue is reproducible without that on Android)
Android only on our side. I usually do dev on iOS and only noticed at the end when I started testing on Android.
Do you want to request a feature or report a bug? bug
What is the current behavior? Dynamic import fails to resolve in a monorepo with React Native version 0.74.0
If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can
yarn install
andyarn test
. I have a min-size demo here https://github.com/Bob-FE/bare-rn-0740-monorepoWhat is the expected behavior? can resolve module with dynamic import