sentry-fastlane-plugin: Source code was not found for app:///main.jsbundle
Hi, I’m not able to link the sourcemaps of a React Native application correctly. Please let me know if you prefer these kind of issues on StackOverflow.
Version: 1.5.0
Sentry is self hosted.
Usage:
sentry_upload_file(
app_identifier: "my.company.App",
file: "./ios/main.jsbundle",
version: "x.x.x"
)
sentry_upload_sourcemap(
app_identifier: "my.company.App",
sourcemap: "./ios/main.jsbundle.map",
rewrite: true,
version: "x.x.x"
)
Output:
--------------------------------
--- Step: sentry_upload_file ---
--------------------------------
sentry-cli 1.39.1 installed!
No config provided, will fallback to .sentryclirc
Starting sentry-cli...
A afa59f1798354779b19cc40c89d3f3937eb8e1cf (4943497 bytes)
Successfully uploaded files to release: my.company.App-x.x.x
-------------------------------------
--- Step: sentry_upload_sourcemap ---
-------------------------------------
sentry-cli 1.39.1 installed!
No config provided, will fallback to .sentryclirc
Starting sentry-cli...
> Analyzing 1 sources
> Rewriting sources
> Adding source map references
> Uploading source maps for release my.company.App-x.x.x
Source Map Upload Report
Source Maps
~/main.jsbundle.map
Successfully uploaded files to release: my.company.App-x.x.x
Error Message:
When I follow the “Release: x.x.x” link I can see the following artifacts:
So I doubt that there’s a problem with missing files, a wrong app_identifier or version number. Seems like the path is wrong but I don’t know how I could control this. Moving the files to the directory from which I’m executing fastlane and using main.jsbundle(.map) as filename didn’t help.
Thanks in advance.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 23 (1 by maintainers)
@lefloh why would you close an unresolved issue?
Still not working for me. I’ll close this one now. I spent hours and couldn’t solve it and it usually takes only two minutes to find the error without sourcemaps.
@lefloh If it’s helpful I also came across this command with the Sentry cli which works well for me.
sentry-cli releases files <VERSION> upload-sourcemaps --bundle ./android/index.android.bundle --bundle-sourcemap ./android/index.android.bundle.map --rewritesentry-cli releases files <VERSION> upload-sourcemaps --bundle ./ios/main.jsbundle --bundle-sourcemap ./ios/main.jsbundle.map --rewriteYou set the auth token, organisation, project etc using the sentry properties file.
@lefloh Sorry typo! It should just be the same as the sourcemap one so:
Have changed above comment so others don’t also get confused.
Hope it now works!
Worked for me too! Seems to be a bug?
If I use
sentry_upload_file, i get an artifact without~/I tried to solve the issue with the sentry-cli directly by experimenting with the
--url-prefixparam. This way I could change the artifact path but it did not solve the issue.If it matters: I also have an iOS and Android Release with the same name.
I was about to suggest a different directory. nbd but could you try with:
sourcemap: "./ios/main.jsbundle.map.js"Could you share how you’re generating your bundle files ? It worked with me by executing:
react-native bundle --platform ios --entry-file <your_entry_file> --dev false --bundle-output ./output/main.ios.jsbundle --sourcemap-output ./output/main.ios.jsbundle.map.jsIn this case my sourcemap is in another directory.