Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Unable to integrate with Expo #258

Open
1 task done
erwin-wijaya opened this issue Apr 11, 2024 · 12 comments
Open
1 task done

[BUG] Unable to integrate with Expo #258

erwin-wijaya opened this issue Apr 11, 2024 · 12 comments
Labels
acknowledged bug Something isn't working needs-triage

Comments

@erwin-wijaya
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

SDK Version

3.0.1

Current Behavior

Having an issue with @react-native-community/netinfo package. It keeps asking to be linked and still didn't work even after that

Expected Behavior

THere isn't a need to do manually linking since the latest package should able to automatically linked

Steps To Reproduce

  1. have an app that is managed by Expo
  2. Initialize Optimizely
  3. run the app

React Framework

react native

Browsers impacted

No response

Link

No response

Logs

No response

Severity

Blocking development

Workaround/Solution

No response

Recent Change

No response

Conflicts

No response

@erwin-wijaya erwin-wijaya added bug Something isn't working needs-triage labels Apr 11, 2024
@mikechu-optimizely
Copy link
Contributor

Hi @erwin-wijaya

Thanks for reporting your findings.

Can I suggest 2 items:

  1. Can you try v3.1.0 that we released yesterday?
  2. Can you post a (sanitized) stacktrace to see a bit more detail? ...especially around @react-native-community/netinfo which we'll need to understand the use a bit more

@erwin-wijaya
Copy link
Author

hi @mikechu-optimizely

Sounds good. I just updated the package and sitll seeing the error.

Here's the error


• Run `react-native link @react-native-community/netinfo` in the project root.
• Rebuild and re-run the app.
• If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods.
• Check that the library was linked correctly when you used the link command by running through the manual installation instructions in the README.
* If you are getting this error while unit testing you need to mock the native module. Follow the guide in the README.

If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-community/react-native-netinfo, js engine: hermes

@mikechu-optimizely
Copy link
Contributor

Hmm 🤔 My react native knowledge is still growing. I'm not sure what the command react-native link @react-native-community/netinfo is doing.

Is there an error that shows an @optimizely reference above the provided error to give me some context?
If you remove the ReactSDK from your project, do you still get the error?

@erwin-wijaya
Copy link
Author

My belief is that the command react-native link @react-native-community/netinfo is an automatic way for installing native dependencies

There aren't any errors pertaining to @optimizely and also no error if I remove the SDK

@mikechu-optimizely
Copy link
Contributor

Thanks @erwin-wijaya. I've created our internal work ticket FSSDK-10121 to dig deeper. We'll create a contrived Expo React Native app and pull in the latest React SDK version to test.

@erwin-wijaya
Copy link
Author

hey @mikechu-optimizely do you know where I can follow the ticket along? And is there any update on this?

@mikechu-optimizely
Copy link
Contributor

Hi @erwin-wijaya The work ticket is internal, but I include it here for other employees to reference.

Let me ping one of our solutions architects who was working on a React Native project and see if they're seeing similar output.

@mikechu-optimizely
Copy link
Contributor

We're still seeing a problem in React Native projects... More research needed...

@junaed-optimizely
Copy link
Contributor

junaed-optimizely commented Jun 24, 2024

@erwin-wijaya could you please provide some details about followings -

  • Expo SDK version
  • @react-native-community/netinfo package version in package.json
  • Are you using dev client?

@erwin-wijaya
Copy link
Author

@junaed-optimizely

  • it was 50.0.8
  • that package is handled by expo, so nto quite sure
  • yes

@junaed-optimizely
Copy link
Contributor

  • You have to install both @react-native-async-storage/async-storage & @react-native-community/netinfo in your project to setup the sdk . See Official Doc.
  • Then You have to build the dev client again to link dependencies automatically.

Let me know if you have done all of these and still facing issues

@erwin-wijaya
Copy link
Author

I had done it before, and tried linking it as well. None of that work.
As mentioned before, with expo, specifically the EAS product, we don't manage much of the packages.
Furthermore, as mentioned above, @react-native-community/netinfo doesn't require linking (please refer to this link ). Either way, I tried to link it and not linking it, and both didn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledged bug Something isn't working needs-triage
Projects
None yet
Development

No branches or pull requests

3 participants