OS:
_Platform:_
Output of node -v && npm -v && npm ls --prod --depth=0
v9.11.1
6.0.1
[email protected] /Users/simon/Documents/kimoby/kimobile
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (git+https://[email protected]/eleretic/react-native-newrelic.git#a1b64afe379b8da6d8a23948288a13c061d5d404)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
Config:
Sentry.config('🔑').install()
I have following issue:
I try to set user context with
Sentry.setUserContext({ userId: 1293847 })
I got this error:

Stacktrace:
java.lang.Double cannot be cast to java.lang.String
getString
ReadableNativeMap.java:168
getUserBuilder
RNSentryModule.java:295
setUser
RNSentryModule.java:177
invoke
Method.java
invoke
JavaMethodWrapper.java:372
invoke
JavaModuleWrapper.java:160
run
NativeRunnable.java
handleCallback
Handler.java:739
dispatchMessage
Handler.java:95
dispatchMessage
MessageQueueThreadHandler.java:29
loop
Looper.java:148
run
MessageQueueThreadImpl.java:192
run
Thread.java:818
I tried with
Sentry.setUserContext({ foo: 1293847 })
I had no error.
Hi there, I just edited this for you. Try not to post your DSN on GitHub.
Please make the userId a string, this should fix it.
It doesn't look like the right way to do it, can't you detect the type instead of making the supposition that it's a _String_?
@HazAT
I ran into the same issue, I haven't seen any mention that userId must be a string in the documentation.
JavaScript is a dynamic language, you can't expect values coming from the JS side to strictly match a string or a double, you should convert between the two representations internally.
@sryze Is absolutely right, this is extremely unexpected behavior. Thanks @HazAT and @masterT for providing a temporary solution and explanation of the underlying issue!
Just ran into this issue today - coincided with building for 64 bit systems as required by Android. Maybe a coincidence, or maybe a lot more people will be encountering this issue!
Most helpful comment
I ran into the same issue, I haven't seen any mention that
userIdmust be a string in the documentation.JavaScript is a dynamic language, you can't expect values coming from the JS side to strictly match a string or a double, you should convert between the two representations internally.