You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{PlatformPlugin,PluginType,SegmentEvent}from'@segment/analytics-react-native';/** * Plugin that injects the user traits to every event */exportclassInjectTraitsextendsPlatformPlugin{type=PluginType.before;execute(event: SegmentEvent){return{
...event,context: {
...event.context,traits: {
...event.context,
...this.analytics!.userInfo.get().traits}}};}}
hi @efstathiosntonas thanks for reporting this. can you please provide the line where segmentClient.track/screen/etc being called? looks like the new optional parameter enrichment causes confusion. will send a fix.
we couldn't reproduce the issue on our end though. it looks like the closure lost context somewhere and was treated as a normal object. but we did able to force the issue to happen if we pass an any object to it. the fix add a safe check on whether the closure is a function. let us know if your issue still persists.
analytics-react-native
version: 2.20.0Steps to reproduce
Expected behavior
Actual behavior
After upgrading to 2.20.0 I get this crash:
Object is not a function
node_modules/@segment/analytics-react-native/src/timeline.ts:79:42
:my setup:
InjectTraits.ts
index.js
The text was updated successfully, but these errors were encountered: