-
Notifications
You must be signed in to change notification settings - Fork 116
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
Error while bundling SVGs on Android after upgrading React Native from 0.67.5 to 0.74.0 #362
Comments
Thanks @nallakshyams, It's quite difficult to help out with your exact problem, but I suspect that something might have gone wrong when you updated I have the example app for this library that is using the latest versions of both libraries: |
Thanks for the reply @kristerkari . I am experiencing an out of memory error when bundling SVGs using react-native-svg-transformer. My project involves a large number of SVG images (around 300), and I have modified the code to dynamically import these images rather than importing each one as an independent component. Code Implementation App.js
images.js
ImageComponent.js
After modifying the code to dynamically import SVG images, Metro bundler throws an "out of memory" error when attempting to bundle these images. This issue arises particularly when dealing with a large number of images (around 300 in my case). Request Thank you for your assistance! @kristerkari |
Hi @kristerkari , On more observation. Even when importing just two images dynamically after altering the sample(https://github.com/kristerkari/react-native-svg-example) as mentioned above, the SVGs are being bundled in Metro. if i import SVG directly same as given in the example, i don't see they are bundled. |
I recently upgraded my React Native project from version 0.67.5 to 0.74.0. Since the upgrade, I have been encountering an error while bundling SVGs on both Android and iOS.
Error:
Environment:
Step(s) to Reproduce:
-Upgrade React Native from 0.67.5 to 0.74.0 and follow react-native-svg and react-native-svg-transformer docs.
Tried below but issue persist:
1.Attempt to bundle the project for Android using the following script:
"bundle:android": "NODE_OPTIONS='--max_old_space_size=8192' npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res",
2.Attempt to increase the node memory using the following script:
"start": "node --expose-gc --max-old-space-size=8192 node_modules/.bin/react-native start --reset-cache",
Additional Context:
The issue occurs only after the upgrade.
It seems to be related to the memory allocation during the bundling process.
Any guidance or suggestions to resolve this issue would be greatly appreciated. Thank you!
The text was updated successfully, but these errors were encountered: