segmentio / analytics-react-native

The hassle-free way to add analytics to your React-Native app.
https://segment.com/docs/sources/mobile/react-native/
MIT License
354 stars 182 forks source link

An internal error occurred: , [Error: Error on Firebase Track] in expo #849

Closed BhavyaCodeAlchemy closed 12 months ago

BhavyaCodeAlchemy commented 1 year ago

configure segment key :

import { FirebasePlugin } from "@segment/analytics-react-native-plugin-firebase";

const segmentClient = createClient({ writeKey: config.SEGMENT_KEY, });

after configure segment key i will add firebase plugin like below :

segmentClient.add({ plugin: new FirebasePlugin() });

after add FirebasePlugin to my segmentClient. i used segmentClient.track("event text") for event i got An internal error occurred: , [Error: Error on Firebase Track] Error

An internal error occurred: , [Error: Error on Firebase Track] at node_modules/@sentry/utils/cjs/instrument.js:113:6 in logger.CONSOLE_LEVELS.forEach$argument_0 at node_modules/@segment/analytics-react-native/src/logger.ts:28:3 in Logger at node_modules/@segment/analytics-react-native/src/analytics.ts:775:2 in SegmentClient#reportInternalError at node_modules/@segment/analytics-react-native-plugin-firebase/src/FirebasePlugin.tsx:63:3 in FirebasePlugin

oscb commented 12 months ago

Is this in expo go or a managed expo build?

Expo Go does not support native modules such as Firebase is, it sounds like Firebase is crashing here possibly due to that.

I would recommend using Expo Managed Builds instead as it gives you the best of both worlds without having to eject to RN CLI.

mj-iosdev commented 12 months ago

@oscb This is Managed Expo build. I tried to create Development as well as Production build and it is still not able to fix this issue