-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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.60.3] --sourcemap-output | enableHermes: false | gradle file | wrong output path #25693
Comments
Hey, @HazAT, I'm sorry that this broke your workflow! Let's see what we can do.
This was a conscious choice, intended to keep things consistent for users of the two JS engines. The idea is that you will always find the source map at the same location, relative to the bundle file, whether you're using JSC or Hermes. (For context: Previously the Android build did not generate source maps at all.)
This would be massively appreciated - thank you! My suggestion is to change
That should result in the correct source map path being written to the JS bundle. Would that help your use case? Note that Hermes support isn't on Please let me know whether I can help with anything else. |
@motiz88 Thanks for the explanation, I will try to fix this in a PR, will reference you. |
@motiz88 I've created this PR #25700 tested it locally and it works.
One thing you should consider is that this forcefully now creates a source map for all builds and if ppl don't delete the source map before creating the APK, the source map will be shipped with it. In our SDK we cleanup the source map afterward so it will not be bundled: So, if you reconsider your choice of doing that, I can change the PR to not forcefully set the |
The intention was never to bundle the source map into the APK; if that's what we're doing, it's a bug. We might need to put the source map in a different directory to avoid this. However, we do want the release build to generate a source map by default. |
@motiz88 Will try to run it an let you know! |
@motiz88 confirmed, it works! Thx! |
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. |
React Native version:
0.60.3
Steps To Reproduce
react-native init test
cd test/android
./gradlew assembleRelease --stacktrace
android/app/build/generated/assets/react/release/index.android.bundle
//# 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: getsentry/sentry-react-native#612 (comment)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:
react-native/react.gradle
Lines 172 to 175 in 0190c9c
(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.
The text was updated successfully, but these errors were encountered: