question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Errors reported to Sentry, but stack trace is all "Unknown"

See original GitHub issue

Environment

How do you use Sentry? Sentry SaaS (sentry.io)

Which SDK and version? sentry.javascript.react-native v. 2.4.2

Steps to Reproduce

I have no idea.

  • React-Native app, ejected from Expo SDK 41
  • I am running expo publish --release-channel release to create a release

Expected Result

I would look at the log entry and happily continue debugging.

Actual Result

Here’s what I’m seeing in the Sentry dashboard:

Screenshot 2021-06-02 at 12 07 23

This makes sense since here’s what the stack trace looks like:

Error: Text strings must be rendered within a <Text> component.
  at ai(app:///de6b708ef4031fd66a9ac4afafdfa031:106:54895)
  at Nl(app:///de6b708ef4031fd66a9ac4afafdfa031:106:74917)
  at Cl(app:///de6b708ef4031fd66a9ac4afafdfa031:106:74806)
  at Rl(app:///de6b708ef4031fd66a9ac4afafdfa031:106:74659)
  at Pl(app:///de6b708ef4031fd66a9ac4afafdfa031:106:74426)
  at Tl(app:///de6b708ef4031fd66a9ac4afafdfa031:106:71559)
  at Tl([native code])
  at ? (app:///de6b708ef4031fd66a9ac4afafdfa031:106:23573)
  at ? (app:///de6b708ef4031fd66a9ac4afafdfa031:209:3883)
  at an(app:///de6b708ef4031fd66a9ac4afafdfa031:106:23520)
  at ln(app:///de6b708ef4031fd66a9ac4afafdfa031:106:23455)
  at ml(app:///de6b708ef4031fd66a9ac4afafdfa031:106:68245)
  at Ir(app:///de6b708ef4031fd66a9ac4afafdfa031:106:43539)
  at Ir([native code])
  at ? (app:///de6b708ef4031fd66a9ac4afafdfa031:662:2509)
  at y(app:///de6b708ef4031fd66a9ac4afafdfa031:14:587)
  at ? (app:///de6b708ef4031fd66a9ac4afafdfa031:14:1890)
  at y(app:///de6b708ef4031fd66a9ac4afafdfa031:14:587)
  at o(app:///de6b708ef4031fd66a9ac4afafdfa031:14:1066)
  at ? (app:///de6b708ef4031fd66a9ac4afafdfa031:14:1209)
  at f(app:///de6b708ef4031fd66a9ac4afafdfa031:49:155)
  at ? (app:///de6b708ef4031fd66a9ac4afafdfa031:49:864)
  at y(app:///de6b708ef4031fd66a9ac4afafdfa031:137:581)
  at C(app:///de6b708ef4031fd66a9ac4afafdfa031:137:947)
  at callImmediates(app:///de6b708ef4031fd66a9ac4afafdfa031:137:3004)
  at value(app:///de6b708ef4031fd66a9ac4afafdfa031:37:2919)
  at ? (app:///de6b708ef4031fd66a9ac4afafdfa031:37:1095)
  at value(app:///de6b708ef4031fd66a9ac4afafdfa031:37:2611)
  at value(app:///de6b708ef4031fd66a9ac4afafdfa031:37:1065)
  at value([native code])
  at value([native code])

The release artefacts are being sent correctly:

Screenshot 2021-06-02 at 12 10 34

So I looked at the raw data, and it appears that the bundles are not referenced and instead called de6b708ef4031fd66a9ac4afafdfa031.

My Sentry code looks like this:

Sentry.init({
  dsn: config.sentryDSN,
  enableInExpoDevelopment: true,
  debug: __DEV__,
});

Any ideas why this is?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
brkastnercommented, Jul 7, 2021

I finally got it to assign the correct release to events from OTA bundles by overriding both dist and release which means the default settings are not working. Is this because I’m importing from @sentry/react-native instead of sentry-expo since I’m using the bare workflow? I’ve tried using sentry-expo but then the app fails to start.

Regardless, the stack traces were still using Updates.manifest.bundleKey rather than ~/main.jsbundle like the artifacts uploaded by the postPublish hook.

I was able to finally get them working by also rewriting the frames as suggested in the “Self-hosting OTA?” section (even though I’m not hosting the bundles myself).

The final working version looks like this:

import * as Sentry from '@sentry/react-native';
import {RewriteFrames} from "@sentry/integrations";
import * as Updates from 'expo-updates';
import type {ReactNativeOptions} from "@sentry/react-native/dist/js/options";
import type {AppManifest} from "expo-constants/build/Constants.types";

const sentryOptions: ReactNativeOptions = {
    dsn: '...',
    new RewriteFrames({
        iteratee: frame => {
            if (frame.filename) {
                frame.filename = Platform.OS === 'android'
                    ? 'app:///index.android.bundle'
                    : 'app:///main.jsbundle'
            }
            return frame;
        }
    })
};

if (Updates.manifest) {
    const manifest = Updates.manifest as AppManifest;
    if (manifest.revisionId)
        sentryOptions.release = manifest.revisionId;
    if (manifest.version)
        sentryOptions.dist = manifest.version;
}

Sentry.init(sentryOptions);

Either the docs need updating to clarify this must be done manually (regardless of self hosting) or there’s something broken in the bare workflow’s default settings that needs fixing.

0reactions
jennmuengcommented, Nov 21, 2021

@marandaneto Closing as this is expo related only.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Shows unknown "Called from" stack frame in crash report #1620
I checked your issue, and the stacktrace looks fine. Note that you have to switch to thread 0 in the stack trace section....
Read more >
Errors reported to Sentry, but stack trace is all "Unknown"
Coming soon: A brand new website interface for an even better experience!
Read more >
Capturing Errors | Sentry Documentation
The Sentry SDK contains several methods that you can use to explicitly report errors, events, and custom messages in except clauses, critical areas...
Read more >
Know unknown unknowns with Sentry - Gleb Bahmutov
Here is my typical setup for a project that uses Connect web server to serve web pages. Sentry will catch and report all...
Read more >
Error handling - Apollo GraphQL Docs
When Apollo Server formats an error in a response, it sets the code extension ... The stacktrace error field is useful while developing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found