formbricks / formbricks

Open Source Survey Platform
https://formbricks.com
Other
9.16k stars 1.67k forks source link

[BUG] React-Native SDK al #3783

Open TonyDobbs opened 1 month ago

TonyDobbs commented 1 month ago

Issue Summary

I tried to integrate Formbricks ReactNative SDK into my mobile app using the documentation here https://formbricks.com/docs/developer-docs/react-native-in-app-surveys My formbricks installation is self-hosted and can connect via the JS SDK, but when I try the React Native SDK I always see the following errors instead of the survey:

 LOG  🧱 Formbricks - 2024-10-15T16:17:20.923Z [DEBUG] - Fetched 1 surveys during sync: New Survey
 LOG  🧱 Formbricks - 2024-10-15T16:17:20.924Z [DEBUG] - Formbricks: Action "New Session" tracked
 WARN  🧱 Formbricks - Global error:  [TypeError: Cannot read property 'name' of undefined]
 ERROR  🧱 Formbricks - 2024-10-15T16:17:20.924Z [ERROR] - {}

I tried the example code here https://github.com/formbricks/formbricks/blob/main/apps/demo-react-native/src/app.tsx and received the same result. I noticed that if I remove all surveys the error disappears, but I have not found any survey settings/configurations that allow a survey to appear without an error. I found a similar thread on the Discord help channel, but that issue was not resolved.

Steps to Reproduce

  1. Create sample survey on self-hosted formbricks install
  2. Followed integration instructions here (install NPM module, add initialization code, etc) : https://formbricks.com/docs/developer-docs/react-native-in-app-surveys
  3. Ran project and received error

    LOG  🧱 Formbricks - 2024-10-15T17:17:38.233Z [DEBUG] - Custom error handler: no
    LOG  🧱 Formbricks - 2024-10-15T17:17:38.233Z [DEBUG] - Start initialize
    LOG  🧱 Formbricks - 2024-10-15T17:17:38.233Z [DEBUG] - config not set; sending all attributes to backend
    LOG  🧱 Formbricks - 2024-10-15T17:17:38.233Z [DEBUG] - Updating attributes: {"language":"en","testAttr":"attr-test"}
    LOG  🧱 Formbricks - 2024-10-15T17:17:38.659Z [DEBUG] - No existing configuration found.
    LOG  🧱 Formbricks - 2024-10-15T17:17:38.660Z [DEBUG] - No valid configuration found or it has been expired. Creating new config.
    LOG  🧱 Formbricks - 2024-10-15T17:17:38.660Z [DEBUG] - Syncing.
    LOG  🧱 Formbricks - 2024-10-15T17:17:38.661Z [DEBUG] - No cache option set for sync
    LOG  🧱 Formbricks - 2024-10-15T17:17:38.661Z [DEBUG] - syncing with backend
    LOG  🧱 Formbricks - 2024-10-15T17:17:38.829Z [DEBUG] - Fetched 1 surveys during sync: New Survey
    LOG  🧱 Formbricks - 2024-10-15T17:17:38.832Z [DEBUG] - Formbricks: Action "New Session" tracked
    WARN  🧱 Formbricks - Global error:  [TypeError: Cannot read property 'name' of undefined]
    ERROR  🧱 Formbricks - 2024-10-15T17:17:38.850Z [ERROR] - {}

Expected behavior

  1. Create sample survey on self-hosted formbricks install
  2. Followed integration instructions here (install NPM module, add initialization code, etc) : https://formbricks.com/docs/developer-docs/react-native-in-app-surveys
  3. Survey appears on New Session action

Other information

Self hosted Formbricks install on the latest version. React Native Version 0.72.4

Screenshots

Screenshot 2024-10-15 at 10 26 52 AM

Environment

Desktop (please complete the following information)

- OS: MacOS
- Node: 14.2
- npm: 6.14.17
github-actions[bot] commented 1 month ago

Thank you for opening your first issue! 🙏❤️ One of our team members will review it and get back to you as soon as it possible. 😊

jobenjada commented 1 month ago

thanks for flagging!

@dhruwang can you have a look?

/award 150

oss-gg[bot] commented 1 month ago

Awarding TonyDobbs: 150 points 🕹️ Well done! Check out your new contribution on oss.gg/TonyDobbs