Amplitude-JavaScript
Amplitude-JavaScript copied to clipboard
5.5.0 RN Async error
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'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
)
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."
I have the same issue. Running logEvent
without init isn't working. And it's a nice to have in development.