Skip to content
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

Issue: Still showing [native code] even with source maps #74

Closed
hellsan631 opened this issue Sep 13, 2019 · 33 comments
Closed

Issue: Still showing [native code] even with source maps #74

hellsan631 opened this issue Sep 13, 2019 · 33 comments
Assignees

Comments

@hellsan631
Copy link

hellsan631 commented Sep 13, 2019

Really scratching my head here. I am unable to get source maps to correctly work in a provisioned version of sentry, using the latest version of expo & react native.

Releases is correctly set, sentry server version is 9.1.2,
expo: "34.0.4", sentry-expo: "2.0.0",

import * as Sentry from 'sentry-expo';
import Constants from 'expo-constants';

const dsn = 'Something';
const { revisionId: release } = Constants.manifest;

Sentry.init({
  dsn,
  environment: __DEV__ ? 'development' : 'production',
  release,
  enableInExpoDevelopment: true,
  debug: true
});

Sentry.setDist(Constants.nativeBuildVersion); // This doesn't seem to do anything helpful?
Sentry.setRelease(release);

export default Sentry;

Using the post took to upload our source maps, we are still seeing "native code"

Screen Shot 2019-09-12 at 8 14 28 PM

Even though this is thrown inside javascript, with build artifacts existing for that release.

Screen Shot 2019-09-12 at 8 16 25 PM

@bill-pairaktaridis
Copy link

I'm having the same issue. However, it's not happening everywhere. I think it may be connected to the connect() function of Redux. Are you also using it?

@hellsan631
Copy link
Author

hellsan631 commented Sep 15, 2019

@bill-pairaktaridis yes. thank you for noticing that.

This is also happening in more isolated areas as well. functional components that do not connect to a store (within their scope), but may well be imported by components that use connect.

We are currently trying to remove redux, but that is a few months away from being complete.

@bill-pairaktaridis
Copy link

Yes, maybe one of the sentry-expo devs can help out here. In its current form it offers little in the way of actually debugging an issue.

@b4stien
Copy link

b4stien commented Sep 18, 2019

I'm under the impression that it's a prefix issue. My code is prefixed with app:/// vs the uploaded sourcemaps that are in ~/. I have an explicit warning telling me Sentry has not found my sourcemaps. Cf screenshots.

Screenshot 2019-09-18 at 13 31 13

Screenshot 2019-09-18 at 13 35 37

@b4stien
Copy link

b4stien commented Sep 18, 2019

Pinging @HazAT as he wrote the RewriteFrame for app:/// (sorry to disturb if you're not the right person to ask).

@hellsan631
Copy link
Author

When i tried to use the base sentry-native repo, it added the app:// prefix, but didnt solve that problem.

I do not have any warnings about sourcemaps.

It also looks like your code is getting some bundle information (onPress, touchableHandlePress), where as mine is just ending at [native code]

@bill-pairaktaridis
Copy link

@hellsan631 I'll try adding sentry-native to my project and see how it goes. As it stands right now, I'm not getting any meaningful stack trace within my components/screens

@jacinto123
Copy link

I am having this issue as well, anyone got any ideas?

@bill-pairaktaridis
Copy link

bill-pairaktaridis commented Sep 19, 2019

@cruzach @HazAT could you look into this?

Update: I've forked sentry-expo and updated to "@sentry/react-native": "^1.0.6" but it's still happening. You can see my fork here: https://github.com/bill-pairaktaridis/sentry-expo

The app size is still very large, as well, so I'm not sure the clean up task is running.

Update: Upon further investigation, it looks that at least cliCleanUpTask doesn't run during the Expo build process. Not sure what we can do about that.

@cruzach cruzach self-assigned this Sep 27, 2019
@cruzach
Copy link
Contributor

cruzach commented Sep 27, 2019

@b4stien I just got the same error shown on the Sentry dashboard ("Source code was not found"), it's due to the release missing. Can you reinstall sentry-expo (made a fix where the release will then be auto-configured on Sentry.init) , and try again?

@b4stien
Copy link

b4stien commented Sep 27, 2019

@cruzach it works indeed, thank you very much!

@bill-pairaktaridis
Copy link

I don't have any errors in my issues. But the code is still showing up minified and with no mapping to the source. I distinctly remember this working for a while (for me) before the upgrade to the unified Sentry JS SDK.

@cruzach
Copy link
Contributor

cruzach commented Sep 30, 2019

@bill-pairaktaridis haven't been able to repro this behavior on sentry-expo: "2.0.1", yet. is that the version you're using?

@bill-pairaktaridis
Copy link

@cruzach I'm still seeing it. I'll try to set up a clean Expo project and test it on that. Could you also do a rudimentary Redux setup and see if that's the cause? Because right now, this is basically what all my issues look like.
Screenshot 2019-10-01 at 10 58 04 AM

@bill-pairaktaridis
Copy link

@hellsan631 did you get it to work?

@bill-pairaktaridis
Copy link

@cruzach did you try with a built app (I'm using App Bundles, as that's mandatory now for the Google Play Store)?

@bill-pairaktaridis
Copy link

@cruzach I'm seeing that in files that don't contain connect() or react-navigation my errors get reported correctly. So it must be one or the other.

@cruzach
Copy link
Contributor

cruzach commented Oct 8, 2019

I don't believe it's react-navigation related, got a project with the most recent sentry-expo working implementing that, already.

I'll try and repro this, if you have time to put together a minimal example using redux that demonstrates this problem, feel free to link a repro

@bill-pairaktaridis
Copy link

I'm almost positive it has something to do with connect() or in general something that is in my screens. I've had errors pop up in my newly implemented "models" and they are properly presented. I'll comment back when I have newer issues and we can maybe update the docs to reflect this case, as Redux is promoted by Expo themselves.

@bill-pairaktaridis
Copy link

I was able to resolve this! The fault was on my end because I was catching all errors on my AppScreen.js with componentDidCatch. Apparently the way I did it wasn't including breadcrumbs. I removed that and now errors are presented correctly, even though I'd like to be able to centrally handle all errors.

@hellsan631
Copy link
Author

@bill-pairaktaridis how did you catch breadcrumbs as well?

@bill-pairaktaridis
Copy link

@hellsan631 I didn't. I just removed my componentDidCatch and let Sentry handle it. There's definitely a way to do it but in our current development cycle I was just happy to get it working and being able to debug again.

@alexanderritola
Copy link

Sentry docs appear to show how to resolve this.

https://docs.sentry.io/platforms/javascript/react/#error-boundaries

@bill-pairaktaridis
Copy link

Unfortunately, this issue seems to have resurfaced. This is the screen I'm looking at again:

Screenshot 2020-03-30 at 10 20 55 AM

I'm pretty sure this error occurs within a fetch statement, if that is any indication

@cruzach
Copy link
Contributor

cruzach commented Jun 3, 2020

i think this occurs only for unhandled promise rejections on android

see:
sync func call stacktrace

async func call stacktrace

@HazAT curious if this is an issue specific to sentry-expo or if it could be a sentry or general react native issue?

@bill-pairaktaridis
Copy link

@cruzach yes that's what I've surmised as well. I keep getting a couple every day that are all promise rejections that I'm apparently not handling somewhere in the code. Hard to troubleshoot though without any stack trace.

@cruzach
Copy link
Contributor

cruzach commented Jun 4, 2020

i think this is a duplicate of #4

@skoch-tf
Copy link

check if your source map was published with success:

expo publish

Running postPublish hook: sentry-expo/upload-sourcemaps
Created release 1.3.112-r0-CX15Bte!.

@keith-kurak
Copy link

Heads up that I see this same behavior when I call Sentry.captureException() within a MobX State Tree middleware and in a componentDidCatch on my root component. I see a few [native code] blocks on iOS stack traces, depending on the error, but usually get at least some partial sense of where the error is. However, I get almost no useful info out of Android errors. I just put in a support request to Sentry to see if they had any ideas.

@juspeeh
Copy link

juspeeh commented Feb 15, 2021

Also facing similar issues.
expo: 39.0.4
sentry-expo: 3.0.3

Source maps have been uploaded successfully.

Screenshot 2021-02-15 at 17 24 05

@juspeeh
Copy link

juspeeh commented Feb 24, 2021

@cruzach

Any information I can provide to solve this issue? Or any advice I should check on my environment that could cause this issue?

All the errors I'm getting are filled with [native code] and I'm not able to pinpoint any errors from the production environment.

@cruzach
Copy link
Contributor

cruzach commented Mar 1, 2021

I believe this was an upstream sentry issue (getsentry/sentry-react-native#1077) and was just recently fixed. Once a new release is published, you'll just need to remove your node modules and lockfile and reinstall sentry-expo@next, since it should automatically pull in the newest version of @sentry/react-native (unless it's a breaking change)

@cruzach cruzach closed this as completed Mar 1, 2021
@cruzach
Copy link
Contributor

cruzach commented Mar 1, 2021

Newest version of @sentry/react-native was released- 2.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants