Skip to content

Commit 554dc08

Browse files
Merge a769be7 into 4cc74aa
2 parents 4cc74aa + a769be7 commit 554dc08

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/js/integrations/rewriteframes.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { RewriteFrames } from '@sentry/integrations';
22
import type { StackFrame } from '@sentry/types';
33
import { Platform } from 'react-native';
44

5-
import { isExpo } from '../utils/environment';
5+
import { isExpo, isHermesEnabled } from '../utils/environment';
66

77
export const ANDROID_DEFAULT_BUNDLE_NAME = 'app:///index.android.bundle';
88
export const IOS_DEFAULT_BUNDLE_NAME = 'app:///main.jsbundle';
@@ -35,6 +35,13 @@ export function createReactNativeRewriteFrames(): RewriteFrames {
3535
if (frame.filename === '[native code]' || frame.filename === 'native') {
3636
return frame;
3737
}
38+
// Is React Native frame
39+
if (isHermesEnabled() && frame.colno !== undefined) {
40+
// https://github.com/facebook/react/issues/21792#issuecomment-873171991
41+
// hermes columns are 0-based, while v8 and jsc are 1-based
42+
// TODO: This seems to be needed only for Hermes bytecode without debug information
43+
frame.colno += 1;
44+
}
3845

3946
// Expo adds hash to the end of bundle names
4047
if (isExpo() && Platform.OS === 'android') {

0 commit comments

Comments
 (0)