sentry-react-native: Malformed calls from JS: field sizes are different
OS:
- Windows
- MacOS
- Linux
Platform:
- iOS
- Android
SDK:
-
@sentry/react-native(>= 1.0.0) -
react-native-sentry(<= 0.43.2)
SDK version: 4.12.0
react-native version: 0.64.4
Are you using Expo?
- Yes
- No
Are you using sentry.io or on-premise?
- sentry.io (SaaS)
- on-premise
If you are using sentry.io, please post a link to your issue so we can take a look:
[Link to issue]
Configuration:
(@sentry/react-native)
Sentry.init({
dsn: 'https://...@sentry.io/...'
tracesSampleRate: 0.25,
captureFailedRequestsEnabled: true,
debug: true,
enableNdkScopeSync: true,
});
I have following issue:
When calling Sentry.captureMessage("Custom message", 'error') on iOS this error is logged:
ERROR Sentry Logger [error]: Error while sending event: [Error: Exception in HostFunction: Malformed calls from JS: field sizes are different.
[[42,81],[7,0],[[146,100,1673548149834,false]],379]]
I was able to determine this is happening @sentry/react-native calls RNSentry.captureEnvelope() (node_modules/@sentry/react-native/dist/js/wrapper.js:72). Looks like a react-native bridging issue.
Steps to reproduce:
- Call Sentry.captureMessage(“Custom message here”, ‘error’) on iOS
- See that it fails to capture the message.
Actual result:
ERROR Sentry Logger [error]: Error while sending event: [Error: Exception in HostFunction: Malformed calls from JS: field sizes are different.
[[42,81],[7,0],[[142,100,1673548954018,false]],354]]
Expected result:
[Expected result]
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 3
- Comments: 34 (18 by maintainers)
@dnl-jst Thank you for the message, as mentioned above you can try Release build then it will work.
Although the root of the issue is not in the SDK we are working on a fix.
@krystofwoldrich Based on the previous comment of @nkleidis
The error is logged in the console of “debug” builds (builds run on a simulator) and makes the app stop sending events to Sentry either when the
debugoption of Sentry init istrueorfalse.In the
releasebuilds we have not monitored if the error appears, but the Sentry SDK seems to be logging as expected, again either when thedebugproperty of the Sentry init has the value oftrueorfalse.This is the exact error we get:
And after running the code you provided in a previous comment we receive this:
I am not sure if this can be helpful.
We get the same error as well during our react-native migration to 0.70.x. Versions: “@sentry/react-native”: “^5.8.0”, “react-native”: “0.70.13”,
As @dolakzdenek mentioned, the issue is happening only when
debugis true. But I guess that whendebugis turned off, all the issues are hidden. No?Hi I am experiencing this also on
First time it happened after react-native upgrade
Getting error:
I followed this
Output:
LOG The problematic line code is in: RNSentry.captureEnvelope LOG The problematic line code is in: Timing.createTimer
Temp solution ✅
I experimented little bit with init() parameters. I found that it happened only when
debug: trueremoving it or switching to
falsesolved the problem I hope it helps someone to resolve it or identify the issue 🤞🏽This started to happen to me as well after upgrading expo + react-native:
expo: 48.0.18 react-native: 0.71.13 @sentry/react-native: 4.15.2
The issue happens on iOS (haven’t checked on Android yet). And it affects only development builds. The problem doesn’t occur in production, neither when I use expo go.
Setting debug: false/true doesn’t seem to be making any difference to me.
I had to disable sentry on development by setting
enableInExpoDevelopment: falseto be able to run my app.Is there any better workaround for this atm?
Its happening just in Debug builds. Release builds are ok.
@Aryk Thanks for the update, let us know when you do and if the problem is only in
devorreleasetoo.@krystofwoldrich I have not had a chance to upgrade yet, but I will likely be upgrading straight to 5.8 when I upgrade my Expo and maybe the problem will disappear.
I believe I’ve found the issue. There seems to be a size limit to the parameter we can send over the bridge.
I’ve filed the
envelopeByteswith non-sense data and got the same crash.@krystofwoldrich I finally got your debug code above to work and the result is the same as @TheTreek:
I tracked it down by putting console logs at all the points leading towards
RNSentry.captureEnvelope()and saw that there were no logs afterRNSentry.captureEnvelope()(on iOS)I put that code in
App.jsright afterSentry.init()and got:The problematic line code is in: Timing.createTimer@TheTreek How did you track down the
RNSentry.captureEnvelope()? Did you use this?Could you try to call this code to see what is
moduleId81andmethodId0?