[0.60.3] --sourcemap-output | enableHermes: false | gradle file | wrong output path
See original GitHub issueReact Native version: 0.60.3
Steps To Reproduce
react-native init test
cd test/android
- Make sure you have these default settings:
project.ext.react = [
entryFile: "index.js",
enableHermes: false, // clean and rebuild if changing
]
./gradlew assembleRelease --stacktrace
- Check content of
android/app/build/generated/assets/react/release/index.android.bundle
- Check last line, content is:
//# sourceMappingURL=index.android.bundle.packager.map
Expected:
//# sourceMappingURL=index.android.bundle.map
So the problem with this is at least twofold.
First I think if hermes
is not enabled it shouldn’t mess with the --sourcemap-output
parameter at all. Reason why this came up is this: https://github.com/getsentry/sentry-react-native/issues/612#issuecomment-511899296
Hermes apparently needs an intermediate path and messes with this arg which breaks our setup.
At Sentry we try to pick up on this arg to determine the location but, this is not the real location since you move the file there later, see: https://github.com/facebook/react-native/blob/0190c9c97b598b782d677e748d211437b4b85dd1/react.gradle#L172-L175 (Same for bundle)
And also, if the reference on the bottom of the file is not correct we cannot load it correctly.
I am not sure how to solve this since just copying instead of moving really doesn’t. If hermes is enabled it seems to work correctly, I am not sure why the source maps and bundle need to go in the intermediate folder tho.
If you know a way how to fix it, I would provide a PR for it.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:8 (4 by maintainers)
Thanks again for surfacing this and sending a PR! Feel free to tag me on any further issues/requests related to source maps or crash logging.
@motiz88 confirmed, it works! Thx!