Amplitude-JavaScript icon indicating copy to clipboard operation
Amplitude-JavaScript copied to clipboard

5.5.0 RN Async error

Open christhegrand opened this issue 5 years ago • 3 comments

I'm trying to upgrade to version 5.5.0. I'm getting this error in our iOS app on our login screen:

2019-10-11 16:48:28.117 [error][tid:com.facebook.react.AsyncLocalStorageQueue][RCTUtils.m:417] 
Error: {
    message = "Entries must be arrays of the form [key: string, value: string], got: (\n    \"{\\\"deviceId\\\":\\\"41ad874d-83d1-462f-a85a-bb8f72bb457aR\\\",\\\"userId\\\":null,\\\"optOut\\\":false,\\\"sessionId\\\":null,\\\"lastEventTime\\\":null,\\\"eventId\\\":0,\\\"identifyId\\\":0,\\\"sequenceNumber\\\":0}\"\n)";
}

Judging by this Github issue, it might be caused by one of the nulls in there combined with JSON.stringify being called from somewhere in amplitude.native.js?

christhegrand avatar Oct 11 '19 23:10 christhegrand

I'm trying to upgrade to version 5.5.0. I'm getting this error in our iOS app on our login screen:

2019-10-11 16:48:28.117 [error][tid:com.facebook.react.AsyncLocalStorageQueue][RCTUtils.m:417] 
Error: {
    message = "Entries must be arrays of the form [key: string, value: string], got: (\n    \"{\\\"deviceId\\\":\\\"41ad874d-83d1-462f-a85a-bb8f72bb457aR\\\",\\\"userId\\\":null,\\\"optOut\\\":false,\\\"sessionId\\\":null,\\\"lastEventTime\\\":null,\\\"eventId\\\":0,\\\"identifyId\\\":0,\\\"sequenceNumber\\\":0}\"\n)";
}

Judging by this Github issue, it might be caused by one of the nulls in there combined with JSON.stringify being called from somewhere in amplitude.native.js?

I got same error when I amplitude.init(key) with wrong type of key(like number)

bang9 avatar Oct 16 '19 06:10 bang9

Ah, yeah, but null is a valid value for userId according to the Amplitude documentation:

"If you want to explicitly log users out or log events under an anonymous user, then you will need to set the User ID to null and regenerate a new Device ID. You can do this by following the instructions in our SDK documentation. Here is a link to our iOS documentation and here is a link to our Android documentation."

christhegrand avatar Oct 16 '19 20:10 christhegrand

I have the same issue. Running logEvent without init isn't working. And it's a nice to have in development.

gewfy avatar Oct 24 '19 10:10 gewfy