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
[0.73.x] Metro crashes because of __loadBundleAsync
#1191
Comments
|
|
Passing on to Metro |
Hi @huextrat, thanks for the report.
I've just tried this with a fresh app and haven't been able to reproduce a crash or anything that'd suggest a leak. Are you able to reproduce outside your private app at all? I wouldn't expect enabling lazy bundling in itself to increase memory usage particularly, but many parallel bundling requests might be too much. You can try starting Metro with debug logging and experimenting with the memory limit - if you could record a video demonstrating the behaviour you're seeing, that might help us see what's going on. If you don't want to share publicly, feel free to email my GitHub username @ meta.com. DEBUG=Metro:* NODE_OPTIONS=--max-old-space-size=8192 yarn start` |
@huextrat if you need, you can use this reproducer template https://github.com/react-native-community/reproducer-react-native |
Thx @robhogan, I've just e-mailed videos showing the problem. Increasing node memory limit seems to fix the issue, was not able to reproduce with I'm trying to create a project to reproduce when I have a bit of time, but it might be complicated. The problem only seems to arise if the load on the metro is high, which I think implies a project of a certain size. |
Description
From
0.73
metro do lazy bundling as explained in the following proposal:https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0605-lazy-bundling.md#__loadbundleasync-in-metro
Launching iOS & Android apps simultaneously in debug and opening a screen with some lazy components cause metro to bundle those components. After a few seconds, metro is crashing with a JS out of memory:
For now, we have a workaround in
metro.config.js
to disable lazy loading from metro:Why this feature has been enabled on RN ? It degrades the DX by slowing down every interaction within a debug app.
Steps to reproduce
React Native Version
0.73.0
Affected Platforms
Runtime - Android, Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
private repo
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: