-
Notifications
You must be signed in to change notification settings - Fork 18
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
Does react-native-client-sdk (v10) support expo web? #455
Comments
@QuanGao-osmind Thank you so much - for other people who see this: LaunchDarkly team filed internally as 242760 for the investigation of disabling the web |
@louis-launchdarkly Thank you for the reply! We are able to apply a patch to the package to get around the issue in Do you have any suggestions in getting around the CORS issue? |
@QuanGao-osmind the react-native SDK is designed, built and tested for iOS and Android only. Other platforms are not supported. Web is not supported. The cors issue is due to http requests made to the LaunchDarkly mobile endpoints from a browser. We use different endpoints for these platforms and these are also coupled tightly with the use of mobile keys and client side ids. |
Based on the investigation so far, while we have the feature request captured in the internal ticket I mentioned above, currently there is no ETA of when our RN SDK can support expo web. Trying to use the Client ID and the endpoints for the browser could be a thing to try. |
@louis-launchdarkly @yusinto Thank you for the updates! I thought react-native SDK is fully compatible with Expo because of the documentation here If there's no immediate plan to support Expo web, could LD team update this documentation to reflect that? FWIW we tested LD in Expo web in a security-disabled browser and it seems to work fine (with a patch to fix the above issue). It could be very close to get LD fully compatible with all platforms Expo support. |
@yusinto @louis-launchdarkly Followup question, which SDK would you recommend us to use for Expo web? In the documentation for
Do we need to resort to |
My team just ran into this issue as well! ❤️ It's very useful to be able to run our apps in expo web during local development, so I am happy to see there is a ticket to address it, even if there is no ETA yet. 😄 |
@QuanGao-osmind We ended up needing to use both the RN SDK and the JS SDK and have 2 implementations using platform specific modules: Definitely not ideal, but it appears to work. |
@retronouns Thank you for the update! We ended up using a similar approach, except we used RN SDK and React web SDK. |
This issue is stale because it has been open for 90 days without activity. Remove the stale label or comment, or this will be closed in 14 days. |
Describe the bug
We have an expo project that we are targeting both mobile and web platforms. The react-native-client-sdk works well on mobile but crashes in web.
This is the error I see:
which traces to this code in
autoEnv
, looks likePlatform.constants
isundefined
.To reproduce
Follow the SDK doc to initialize LD client and identify user.
Expected behavior
Expect
react-native-client-sdk
to work on all platforms expo support (Android, IOS, web)SDK version
10.1.3
OS/platform
Web browser: Chrome Version 124.0.6367.62
Any insights are greatly appreciated, thank you!
The text was updated successfully, but these errors were encountered: