Skip to content

react-native on android in production make error that can't read #731

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

Closed
vehas opened this issue Sep 20, 2016 · 33 comments · Fixed by #875
Closed

react-native on android in production make error that can't read #731

vehas opened this issue Sep 20, 2016 · 33 comments · Fixed by #875
Assignees

Comments

@vehas
Copy link

vehas commented Sep 20, 2016

i got this in some part of json file in sentry server which send from
raven 3.70 android 6.0.1 Mi4 model
the first one show only [native code] message vs show path and module in the simulater device

"sentry.interfaces.Exception": {
    "exc_omitted": null,
    "values": [
      {
        "stacktrace": {
          "frames": [
            {
              "abs_path": "[native code]",
              "filename": "[native code]",
              "in_app": false
            },
            {
              "function": "forEach",
              "abs_path": "[native code]",
              "filename": "[native code]",
              "in_app": false
            },
            {
              "abs_path": "[native code]",
              "filename": "[native code]",
              "in_app": false
            },
            {
              "abs_path": "[native code]",
              "filename": "[native code]",
              "in_app": false
            },
            {
              "abs_path": "[native code]",
              "filename": "[native code]",
              "in_app": false
            },
            {
              "abs_path": "[native code]",
              "filename": "[native code]",
              "in_app": false
            }
          ],
          "has_system_frames": false,
          "frames_omitted": null
        },
        "mechanism": null,
        "type": "TypeError",
        "module": null,
        "thread_id": null,
        "value": "2 is not a function (evaluating 'e()')",
        "raw_stacktrace": null
      }
    ]
  },

compare with this json in simulator ( api 23, android 6.0.0 )

  "sentry.interfaces.Exception": {
    "exc_omitted": null,
    "values": [
      {
        "stacktrace": {
          "has_system_frames": false,
          "frames": [
            {
              "function": "onmessage",
              "abs_path": "http://localhost:8081/debuggerWorker.js",
              "module": "debuggerWorker",
              "in_app": false,
              "lineno": 39,
              "colno": 56,
              "filename": "/debuggerWorker.js"
            },
            {
              "function": "MessageQueue.callFunctionReturnFlushedQueue",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 11917,
              "colno": 1,
              "filename": "/index.android.bundle"
            },
            {
              "function": "guard",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 11849,
              "colno": 1,
              "filename": "/index.android.bundle"
            },
            {
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 11918,
              "colno": 8,
              "filename": "/index.android.bundle"
            },
            {
              "function": "MessageQueue.__callFunction",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 12036,
              "colno": 34,
              "filename": "/index.android.bundle"
            },
            {
              "function": "Object.receiveTouches",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 19688,
              "colno": 25,
              "filename": "/index.android.bundle"
            },
            {
              "function": "Object._receiveRootNodeIDEvent",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 19626,
              "colno": 14,
              "filename": "/index.android.bundle"
            },
            {
              "function": "Object.batchedUpdates",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 20889,
              "colno": 18,
              "filename": "/index.android.bundle"
            },
            {
              "function": "Object.batchedUpdates",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 33163,
              "colno": 13,
              "filename": "/index.android.bundle"
            },
            {
              "function": "ReactDefaultBatchingStrategyTransaction.perform",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 21685,
              "colno": 12,
              "filename": "/index.android.bundle"
            },
            {
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 19627,
              "colno": 25,
              "filename": "/index.android.bundle"
            },
            {
              "function": "Object.handleTopLevel",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 20727,
              "colno": 1,
              "filename": "/index.android.bundle"
            },
            {
              "function": "runEventQueueInBatch",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 20716,
              "colno": 16,
              "filename": "/index.android.bundle"
            },
            {
              "function": "Object.processEventQueue",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 20025,
              "colno": 1,
              "filename": "/index.android.bundle"
            },
            {
              "function": "forEachAccumulated",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 20690,
              "colno": 5,
              "filename": "/index.android.bundle"
            },
            {
              "function": "executeDispatchesAndReleaseTopLevel",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 19849,
              "colno": 8,
              "filename": "/index.android.bundle"
            },
            {
              "function": "executeDispatchesAndRelease",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 19838,
              "colno": 18,
              "filename": "/index.android.bundle"
            },
            {
              "function": "Object.executeDispatchesInOrder",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 20408,
              "colno": 1,
              "filename": "/index.android.bundle"
            },
            {
              "function": "executeDispatch",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 20385,
              "colno": 17,
              "filename": "/index.android.bundle"
            },
            {
              "function": "Object.invokeGuardedCallback",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 20553,
              "colno": 8,
              "filename": "/index.android.bundle"
            },
            {
              "function": "Constructor.proxiedMethod [as touchableHandleResponderRelease]",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 9068,
              "colno": 22,
              "filename": "/index.android.bundle"
            },
            {
              "function": "Constructor.touchableHandleResponderRelease",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 26566,
              "colno": 6,
              "filename": "/index.android.bundle"
            },
            {
              "function": "Constructor.proxiedMethod [as _receiveSignal]",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 9068,
              "colno": 22,
              "filename": "/index.android.bundle"
            },
            {
              "function": "Constructor._receiveSignal",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 26792,
              "colno": 6,
              "filename": "/index.android.bundle"
            },
            {
              "function": "Constructor.proxiedMethod [as _performSideEffectsForTransition]",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 9068,
              "colno": 22,
              "filename": "/index.android.bundle"
            },
            {
              "function": "Constructor._performSideEffectsForTransition",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 26876,
              "colno": 6,
              "filename": "/index.android.bundle"
            },
            {
              "function": "Constructor.proxiedMethod [as touchableHandlePress]",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 9068,
              "colno": 22,
              "filename": "/index.android.bundle"
            },
            {
              "function": "Constructor.touchableHandlePress",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 58914,
              "colno": 32,
              "filename": "/index.android.bundle"
            },
            {
              "function": "Object.onPress",
              "abs_path": "http://localhost:8081/index.android.bundle?platform=android&dev=true&hot=true&minify=false",
              "module": "<unknown module>",
              "in_app": false,
              "lineno": 123937,
              "colno": 100,
              "filename": "/index.android.bundle"
            }
          ],
          "frames_omitted": null
        },
        "mechanism": null,
        "type": "TypeError",
        "module": null,
        "thread_id": null,
        "value": "a is not a function",
        "raw_stacktrace": null
      }
@benvinegar
Copy link
Contributor

@vehas – the stack trace is what React Native gives us through its own error handler. We certainly don't re-write the stack trace to say [native code].

This is probably just a limitation of React Native production builds on Android. Anecdotally, iOS seems to give much more.

@antoinerousseau
Copy link

antoinerousseau commented Oct 20, 2016

@vehas how did you work around this? got the same issue on my LG G3

@khanghoang
Copy link

@benvinegar I don't think it because of React Native on Android, in fact I managed to get the log of a crash on production Android app. It looks like this

E/ReactNativeJS: Can’t find variable: a
E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
                                                          Process: com.ehlife, PID: 4225
                                                          com.facebook.react.common.JavascriptException: Can’t find variable: a, stack:
                                                          onPress@1142:836
                                                          touchableHandlePress@319:1163
                                                          _performSideEffectsForTransition@165:8280
                                                          _receiveSignal@165:6789
                                                          touchableHandleResponderRelease@165:4275
                                                          a@120:72
                                                          c@119:421
                                                          i@119:616
                                                          f@117:163
                                                          g@117:291
                                                          i@122:84
                                                          processEventQueue@117:1298
                                                          s@123:92
                                                          handleTopLevel@123:178
                                                          <unknown>@115:847
                                                          perform@132:528
                                                          batchedUpdates@213:481
                                                          a@125:346
                                                          _receiveRootNodeIDEvent@115:819
                                                          receiveTouches@115:1193
                                                          value@58:3762
                                                          <unknown>@58:1998
                                                          b@58:626
                                                          value@58:1970

                                                              at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:95)
                                                              at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:79)
                                                              at java.lang.reflect.Method.invoke(Native Method)
                                                              at java.lang.reflect.Method.invoke(Method.java:372)
                                                              at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:322)
                                                              at com.facebook.react.cxxbridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
                                                              at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
                                                              at android.os.Handler.handleCallback(Handler.java:739)
                                                              at android.os.Handler.dispatchMessage(Handler.java:95)
                                                              at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
                                                              at android.os.Looper.loop(Looper.java:135)
                                                              at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
                                                              at java.lang.Thread.run(Thread.java:818)

I think above log is okay because I tried the same crash on iOS production build and here is the iOS crash log

2016-10-31 17:45:25.585 [fatal][tid:com.facebook.react.RCTExceptionsManagerQueue] Unhandled JS Exception: Can’t find variable: a
2016-10-31 17:45:25.597 EHLife[40850:506254] *** Terminating app due to uncaught exception ‘RCTFatalException: Unhandled JS Exception: Can’t find variable: a’, reason: ‘Unhandled JS Exception: Can’t find variable: a, stack:
onPress@1147:837
touchableHandlePress@321:1163
_performSideEffectsForTransition@298:8280
_receiveSignal@298:6789
touchableHandleResponderRelease@298:4275
a@119:72
c@118:396
i@118:591
f@116:163
i@121:84
processEventQueue@116:1273
s@122:92
handleTopLevel@122:178
<unknown>@114:847
perform@131:503
batchedUpdates@216:456
a@124:321
_receiveRootNodeIDEvent@114:819
receiveTouches@114:1193
value@35:3089
<unknown>@35:1325
b@35:602
value@35:1297
‘
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000104e8e34b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x0000000103d9e21e objc_exception_throw + 48
    2   CoreFoundation                      0x0000000104ef7265 +[NSException raise:format:] + 197
    3   EHLife                              0x0000000103559c65 RCTFatal + 393
    4   EHLife                              0x00000001035531ec -[RCTExceptionsManager reportFatalException:stack:exceptionId:] + 549
    5   CoreFoundation                      0x0000000104e1505c __invoking___ + 140
    6   CoreFoundation                      0x0000000104e14ee1 -[NSInvocation invoke] + 289
    7   CoreFoundation                      0x0000000104e2ced6 -[NSInvocation invokeWithTarget:] + 54
    8   EHLife                              0x0000000103556f25 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 604
    9   EHLife                              0x000000010357d3a1 -[RCTBatchedBridge _handleRequestNumber:moduleID:methodID:params:] + 219
    10  EHLife                              0x000000010357cc0b __33-[RCTBatchedBridge handleBuffer:]_block_invoke.329 + 492
    11  libdispatch.dylib                   0x0000000108d6a810 _dispatch_call_block_and_release + 12
    12  libdispatch.dylib                   0x0000000108d8c12e _dispatch_client_callout + 8
    13  libdispatch.dylib                   0x0000000108d71523 _dispatch_queue_serial_drain + 1018
    14  libdispatch.dylib                   0x0000000108d71cf3 _dispatch_queue_invoke + 1118
    15  libdispatch.dylib                   0x0000000108d7209b _dispatch_queue_override_invoke + 376
    16  libdispatch.dylib                   0x0000000108d73a0e _dispatch_root_queue_drain + 506
    17  libdispatch.dylib                   0x0000000108d737b4 _dispatch_worker_thread3 + 113
    18  libsystem_pthread.dylib             0x00000001091324de _pthread_wqthread + 1129
    19  libsystem_pthread.dylib             0x0000000109130341 start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException

@benvinegar
Copy link
Contributor

benvinegar commented Nov 18, 2016

@benvinegar I don't think it because of React Native on Android, in fact I managed to get the log of a crash on production Android app. It looks like this

Note that that those values don't include filenames (e.g. touchableHandlePress@321:1163). You're looking at a level that the React Native plugin cannot (the Android crash dump) because it is a pure JavaScript solution.

An error object is passed through the handler via ErrorUtils.setGlobalHandler. It takes the values and passes them to Sentry. If they are not formatted correctly, there's not much we can do. Note also that "[native code]" does not appear in the Raven source code. AFAICT, this is not a case where we see a value we don't recognize and just convert it to [native code].

Unfortunately I'm not an Android developer, so there's not much I can do here other than to say – if you find something that's incorrect, that can be addressed from the JavaScript layer, I'd be glad to accept PRs.

One thing you could try is making a dump of the raw error from the React Native plugin and see if it differs from the crash that appears in Sentry.

@khanghoang
Copy link

@benvinegar I got your point, but it's a single bundle of javascript code so that IMO there is no need for filename (you can see that there is no file name for ios, but it works just fine on iOS).

Because our company uses Sentry for RN on production so we will try our best to figure out what we can do about this.

@denstepa
Copy link

denstepa commented Jan 5, 2017

We faced the same issue, and this fix denstepa@885f0a1 helped us to get stacktraces and source maps working for android in production mode. The problem was with path to file that was index.android.bundle, without file:/// in the beginning as it was for iOS

I will try to check if it could causes problems in other browsers etc and will do pull request a bit later

@khanghoang
Copy link

@denstepa keep us in the loop, thanks

@danieldkim
Copy link

I tried out @denstepa's fix (with RN 0.40.0). It kinda works but the Sentry UI gets confused trying to map it to the original source and messes up the top frame of the stack trace. The raw JSON looks a bit better but the colno attribute is off. The context_line attribute does, however, seem to have the appropriate data. It doesn't seem to be related to the colno so I'm not sure how that data is derived. In any event, although that code snippet in the context_line is from the raw bundle it's useful and better than nothing.

@khanghoang
Copy link

@danieldkim I think it will be better if we can test @denstepa's fix with RN <0.40.x since there are breaking changes in 0.40.x.

@danieldkim
Copy link

OK that's fine but I don't think there any breaking changes in that 0.40.0 that would affect this issue.

@benvinegar
Copy link
Contributor

Hey everyone here – I would love to take this fix upstream, but I need:

  • Some actual test frames from real RN on Android data to put into tests
  • Some verification that the fix is working – I'm getting mixed answers here

Can someone help?

@khanghoang
Copy link

@benvinegar I can help you to create minimum RN project that can reproduce the bug. Is it what you're looking for?

@ACBrown
Copy link

ACBrown commented Feb 2, 2017

@benvinegar I'm not sure how to create the test frames, but I can confirm that the fix is working for me. I'm currently using @denstepa's fix in my Android app in prod (running react native 0.37).

@misterecco
Copy link

@benvinegar I also confirm that the fix is working for me

orlando added a commit to orlando/raven-js that referenced this issue Feb 17, 2017
@benvinegar
Copy link
Contributor

benvinegar commented Feb 18, 2017

@khanghoang – I'm just looking for a set of frames, e.g. dumped/printed from a RN app on Android, that I can use to create an automated test case to prevent future regressions.

e.g. like those found here.

If anyone can provide this, I will gladly merge in the fix, the test, and publish a new version.

@misterecco
Copy link

@benvinegar Here is a stacktrace from my app

Error: test
  at render(/home/tomek/qed-workspace/geosurvey.collect.react/src/components/GpsMonitorScene.js:78:24)
  at _renderValidatedComponentWithoutOwnerOrContext(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:1050:29)
  at _renderValidatedComponent(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:1075:15)
  at renderedElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:484:29)
  at _currentElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:346:40)
  at child(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js:68:25)
  at children(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js:264:10)
  at this(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeBaseComponent.js:74:41)
  at _currentElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeBaseComponent.js:212:6)
  at child(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js:68:25)
  at renderedElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:496:6)
  at _currentElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:346:40)
  at child(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js:68:25)
  at children(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js:264:10)
  at this(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeBaseComponent.js:74:41)
  at _currentElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeBaseComponent.js:212:6)
  at child(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js:68:25)
  at renderedElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:496:6)
  at _currentElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:346:40)
  at child(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js:68:25)
  at renderedElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:496:6)
  at _currentElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:346:40)
  at child(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js:68:25)
  at renderedElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:496:6)
  at _currentElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:346:40)
  at nextChildInstance(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js:68:25)
  at prevChildren(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactChildReconciler.js:157:10)
  at prevChildren(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js:227:6)
  at nextNestedChildrenElements(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js:345:6)
  at nextElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js:331:25)
  at _currentElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeBaseComponent.js:130:24)
  at prevChild(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js:166:25)
  at prevChildren(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactChildReconciler.js:143:10)
  at prevChildren(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js:227:6)
  at nextNestedChildrenElements(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js:345:6)
  at nextElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js:331:25)
  at _currentElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeBaseComponent.js:130:24)
  at prevChild(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js:166:25)
  at prevChildren(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactChildReconciler.js:143:10)
  at prevChildren(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js:227:6)
  at nextNestedChildrenElements(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js:345:6)
  at nextElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactMultiChild.js:331:25)
  at _currentElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/native/ReactNativeBaseComponent.js:130:24)
  at prevComponentInstance(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js:166:25)
  at transaction(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:982:8)
  at nextParentElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:944:34)
  at transaction(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:847:8)
  at _currentElement(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:710:6)
  at prevComponentInstance(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactReconciler.js:166:25)
  at prevComponentInstance(/home/tomek/qed-workspace/geosurvey.collect.react/node_modules/react-native/Libraries/Renderer/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js:982:8)

@benvinegar benvinegar self-assigned this Feb 21, 2017
@ptgamr
Copy link

ptgamr commented Feb 28, 2017

@benvinegar I have an android app which also has this issue. I'm happy to provide the dump/printed if you could guide me how to get it?

@benvinegar
Copy link
Contributor

Does everybody else's traces look like the one posted by @misterecco?

benvinegar added a commit that referenced this issue Mar 1, 2017
1. Don't treat presence of "native" string everywhere as meaning "native code"
2. Properly parse when not protocol / only leading forward slash

fixes #731
@benvinegar
Copy link
Contributor

Participants on this thread: could you check out #875 and let me know if that works for you? The test is using the sample stack trace from @misterecco.

@khanghoang
Copy link

@benvinegar the problem is still there :(
error hi there 2017-03-05 18-03-21

@benvinegar
Copy link
Contributor

@khanghoang – using #875?

Can you dump the stack trace somewhere?

@benvinegar
Copy link
Contributor

benvinegar commented Mar 5, 2017

Basically, I can't accept @denstepa's fix until I (or someone else) can write a test that demonstrates/explains why we are matching this:

[^@]*bundle

It's probably related index.android.bundle, but this part of the regex is for matching on origin, e.g. https:// ... I need to see a raw example that we can build a test on.

@brunolemos
Copy link

@denstepa can you help us write a test to get this deployed?

@khanghoang
Copy link

@benvinegar yes, I used #875 and it still didn't work

benvinegar added a commit that referenced this issue Mar 23, 2017
1. Don't treat presence of "native" string everywhere as meaning "native code"
2. Properly parse when not protocol / only leading forward slash

fixes #731
@bood
Copy link

bood commented Apr 15, 2017

@benvinegar
Have this issue too (react-native 0.42.3, raven-js 3.14.1), and here is a raw example I get from the input of computeStackTraceFromStackProp, i.e. ex.stack

It looks to me that the issue is that the url part does not have a special origin, so the regex cannot match. What @denstepa's fix does is simply match with a bundle suffix, cannot say it's appropriate or not. Any reason why not we just treat the string between @ and : as the url?

This is the one when the bundle lives in asset

value@lexie/main.jsbundle:399:1437
value@lexie/main.jsbundle:399:1130
value@lexie/main.jsbundle:399:1076
value@lexie/main.jsbundle:127:672
close@lexie/main.jsbundle:216:291
closeAll@lexie/main.jsbundle:134:1270
perform@lexie/main.jsbundle:134:704
a@lexie/main.jsbundle:227:255
perform@lexie/main.jsbundle:134:617
batchedUpdates@lexie/main.jsbundle:210:485
o@lexie/main.jsbundle:126:412
renderComponent@lexie/main.jsbundle:227:1034
c@lexie/main.jsbundle:173:141
r@lexie/main.jsbundle:324:116
run@lexie/main.jsbundle:320:419
runApplication@lexie/main.jsbundle:320:1009
value@lexie/main.jsbundle:30:2778
lexie/main.jsbundle:30:1013
lexie/main.jsbundle:30:106
value@lexie/main.jsbundle:30:985
[native code]

This is the one when the bundle lives in cache

value@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:399:1437
value@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:399:1130
value@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:399:1076
value@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:127:672
close@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:216:291
closeAll@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:134:1270
perform@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:134:704
a@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:227:255
perform@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:134:617
batchedUpdates@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:210:485
o@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:126:412
renderComponent@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:227:1034
c@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:173:141
r@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:324:116
run@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:320:419
runApplication@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:320:1009
value@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:30:2778
/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:30:1013
/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:30:106
value@/storage/emulated/0/Android/data/com.a.b/cache/bundle/lexie/1.1.0/main.jsbundle:30:985
[native code]

@valeryq
Copy link

valeryq commented Apr 18, 2017

@benvinegar +1. I have this on Android.

Error: CUSTOM ERROR
  at ? ([native code])
  at ? ([native code])
  at ? ([native code])
  at ? ([native code])
  at forEach([native code])
  at ? ([native code])

For iOS it's okey:

Error: CUSTOM ERROR
  at onPress(/Users/vagrant/git/src/routes.js:220:28)
  at e(/Users/vagrant/git/node_modules/react-native/Libraries/Components/Touchable/TouchableOpacity.js:125:45)
  at touchableHandlePress([native code])
  at e(/Users/vagrant/git/node_modules/react-native/Libraries/Components/Touchable/Touchable.js:742:34)
  at _performSideEffectsForTransition([native code])
  ...

@misterecco
Copy link

@benvinegar The fix added in 3.14.0 release doesn't seem to work.

I'm sorry if it's because of the stacktrace I posted before (which was most probably not obtained correctly).

Here are two raw stacktraces straight from logcat. I hope they will be more useful in resolving the issue (@denstepa's fork still seems to be working fine). I'm using react native v0.42.3

RN_str_1.txt
RN_str_2.txt

@chetankothari
Copy link

I am still facing the issue. Would like to check on the status of this.

Using:
raven-js: 3.15.0
react-native: 0.42.3

Would be glad to give any additional info required.

Thanks :)

@alexkring
Copy link

I am facing this issue as well. It's really a blocker for us right now, given that we cant get crash reports on sentry for android without this working. I'm going to look for a solution, let me know if you guys find anything.

@f0rr0
Copy link

f0rr0 commented May 11, 2017

Same here, I tried @denstepa's fix as well. Not working

@alexkring
Copy link

@denstepa's fix mostly works, but the only thing that appears to be off, is that the very top of the callstack, where the exception occurs, is off. It points to the wrong line of code. All of the other parts of the stack trace point to the correct line of code. So maybe his fix works, but there is some other bug as well?

alexkring pushed a commit to Nextdoor/raven-js that referenced this issue May 11, 2017
@LowieHuyghe
Copy link

I can confirm what @alexkring says. Using the Nextdoor/raven-js fork I actually get a stacktrace instead of the [native code]. Also the first row of the callstack indeed seems to be off.

@HazAT
Copy link
Member

HazAT commented Jun 28, 2017

This has been fixed and will be in the next release.

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

Successfully merging a pull request may close this issue.