Sourcemaps are not correctly uploaded and crashes in issues don't reference JS source code
OS:
- [*] MacOS
Platform:
- [*] iOS
SDK:
- [*]
@sentry/react-native(>= 1.0.0)
SDK version: 5.15.0
react-native version: 0.71.12
Are you using Expo?
- [*] No
Are you using sentry.io or on-premise?
- [*] on-premise
Configuration:
(@sentry/react-native)
Sentry.init({
dsn: "https://[email protected]/694",
tracesSampleRate: 1.0,
});
I have the following issue:
- Upon manual upload of source maps script main.jsbundle uploaded with zero size
- Crash information for the release doesn't contain references to the JS source code
Steps to reproduce:
-
Step 1 generate bundle and sourcemap according to documentation https://docs.sentry.io/platforms/react-native/sourcemaps/uploading/hermes/
-
Step 2 upload sourcemaps to sentry (screenshot of uploading command/process attached)
Actual result:
- main.jsbundle is shown with zero bytes size in sourcemaps for the release
- crash references in issues for the release are not pointing to the line numbers in JS source code
Expected result:
- main.jsbundle is uploaded with it's original content and size
- crash references in issues for the release are pointing to the JS source code
For android upload source maps was successful, but still no references to source code
Hi @anagovitsyn, thank you for the message,
have you setup Sentry in your metro.config.js? The uploaded source maps are missing Debug IDs to be linked to the correct source code.
I would also recommend updating to the latest SDK version, https://github.com/getsentry/sentry-react-native/releases/tag/5.22.0.
Hi @anagovitsyn, thank you for the message,
have you setup Sentry in your
metro.config.js? The uploaded source maps are missing Debug IDs to be linked to the correct source code.I would also recommend updating to the latest SDK version, https://github.com/getsentry/sentry-react-native/releases/tag/5.22.0.
Where can I get debug ids for matching source maps when upload using sentry-cli?
I see that sourcemaps are linked to the release, but still no references to source code in crashes
Although the source maps are linked, the might not be the correct source maps for the build.
Debug IDs help with that making sure only the appropriate source maps are used.
The guide that you linked ensures Debug IDs are generated.
https://docs.sentry.io/platforms/react-native/sourcemaps/uploading/hermes/
Could you share how does your metro.config.js looks like?
I used npx @sentry/wizard@latest -i reactNative command to setup sentry. We have already customized metro.config.js, just added there code for sentry and got error, so it doesn't work showing this error
here is package.json package.json
Hi @anagovitsyn, thank you for the details.
From the package.json I see you are using [email protected] with [email protected].
But RN ships with [email protected], can you upgrade to that version?
Thank you. I have upgraded metro to 0.73.10 and previous error 'size' of undefined had gone and now build is successful on both platforms. But now new error both on ios and android upon startup of the app, though nothing was changed in source code structure, and index.js where call to registerComponent is - is unchanged in comparison with code without sentry and all the updates to the packages.json.
Here's updated package.json package.json
@hubertdeng123 Can you try to isolate the issue, does it happen without createSentryMetroSerializer? Or without Sentry only with [email protected] upgrade?
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
@hubertdeng123 Can you try to isolate the issue, does it happen without
createSentryMetroSerializer? Or without Sentry only with[email protected]upgrade?
All problems with build errors finaly closed. There was problem using react-navigation package alone i.e. import { Header } from 'react-navigation' which is not supported after upgrading to use centry. This error was preceeding message of "GoGym" is not registed module, and was the couse of "registerComponent wasn't called"
And now I have upon iOS successful build this error message
so it still doen't solved. What are next steps to solve the issue? Our server-side centry version
@anagovitsyn If you can, upgrade to the latest Sentry on your server, that will solve the issue.
Or add export AUTO_RELEASE=true # Automatically detect release from Xcode project which will add the required slug.
https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/#configure-automatic-source-maps-upload
Now everything is solved, after I have upgraded sentry client version to 5.19.1. It works ok with backend 23.5.2 and now I can see mapping of errors to source code.
Thank you