File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { RewriteFrames } from '@sentry/integrations';
2
2
import type { StackFrame } from '@sentry/types' ;
3
3
import { Platform } from 'react-native' ;
4
4
5
- import { isExpo } from '../utils/environment' ;
5
+ import { isExpo , isHermesEnabled } from '../utils/environment' ;
6
6
7
7
export const ANDROID_DEFAULT_BUNDLE_NAME = 'app:///index.android.bundle' ;
8
8
export const IOS_DEFAULT_BUNDLE_NAME = 'app:///main.jsbundle' ;
@@ -35,6 +35,13 @@ export function createReactNativeRewriteFrames(): RewriteFrames {
35
35
if ( frame . filename === '[native code]' || frame . filename === 'native' ) {
36
36
return frame ;
37
37
}
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
+ }
38
45
39
46
// Expo adds hash to the end of bundle names
40
47
if ( isExpo ( ) && Platform . OS === 'android' ) {
You can’t perform that action at this time.
0 commit comments