Open QuanGao-osmind opened 7 months ago
Hello @QuanGao-osmind, we will look into turning off autoEnv
for the web (Filed internally as 242760). In the meantime, while it is extra effort and trouble for you, I wonder if disabling autoEnv
when you build for the web platform could work?
Also, if you don't mind, could you post this to https://github.com/launchdarkly/js-core? That is where the RN SDK v10 (and beyond) lives.
Hello @louis-launchdarkly thank you for the reply! We end up adding a patch for the package to prevent it from crashing on web. Now we are seeing a CORS issue since there's no CORS headers served on mobile endpoint. (After disabling browser security, it works as expected)
I will post issues related to react-native-client-sdk to the other repo you suggested!
Hello @louis-launchdarkly thank you for the reply! We end up adding a patch for the package to prevent it from crashing on web. Now we are seeing a CORS issue since there's no CORS headers served on mobile endpoint. (After disabling browser security, it works as expected)
I will post issues related to react-native-client-sdk to the other repo you suggested!
What was the fix?
@wahidshafique We had to install two SDKs, LD React SDK for web, and LD React-native SDK for IOS and Android.
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
, seems likePlatform.constants
is undefined somehow.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!