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:

error-message

When I follow the “Release: x.x.x” link I can see the following artifacts:

files

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)

Most upvoted comments

@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 --rewrite

sentry-cli releases files <VERSION> upload-sourcemaps --bundle ./ios/main.jsbundle --bundle-sourcemap ./ios/main.jsbundle.map --rewrite

You 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:

sentry_upload_sourcemap(
  app_identifier: "my.company.App",
  sourcemap: "./ios/main.jsbundle",
  rewrite: true,
  version: "x.x.x"
)
sentry_upload_sourcemap(
  app_identifier: "my.company.App",
  sourcemap: "./ios/main.jsbundle.map",
  rewrite: true,
  version: "x.x.x"
)

Have changed above comment so others don’t also get confused.

Hope it now works!

Try doing this instead:

sentry_upload_sourcemap(
  app_identifier: "my.company.App",
  sourcemap: "./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"
)

Worked for me too! Seems to be a bug?

If I use sentry_upload_file, i get an artifact without ~/

Screenshot 2021-01-28 at 16 04 52

I tried to solve the issue with the sentry-cli directly by experimenting with the --url-prefix param. 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.js In this case my sourcemap is in another directory.