Closed mateuszroth closed 2 months ago
Hello @mateuszroth,
This appears that it may be an intermittent issue related to the dev tools. I was able to get the same error, but with different node numbers, by reloading the application a few times.
That issue included a banner which directed to this issue with the dev tools: https://github.com/facebook/react/issues/27728
Additionally the callstack is entirely within the react dev tools. That said it is possible that we trigger some situation that increases the probability of this happening.
Thank you, Ryan
Thank you. Actually the issue was caused on our side I believe. We were mapping flags and we forgot about null case, sorry:
import { type LDFlagSet } from '@launchdarkly/react-native-client-sdk';
import { camelCase } from 'change-case';
/**
* Converts flags map provided by LaunchDarkly to our custom flags map. Changes flag key case to camelCase.
* Ensures no extra flags are set.
*/
export function mergeFeatureFlags<T>(newFlags: LDFlagSet, defaultFlags: T): T {
const allFlags = Object.entries(newFlags).reduce(
(acc, [flagKey, flagValue]) => {
const normalizedFlagKey = camelCase(flagKey);
const isValidKey = normalizedFlagKey in (defaultFlags as object);
if (!isValidKey) {
return acc;
}
return { ...acc, [normalizedFlagKey]: flagValue };
},
{ ...defaultFlags },
);
return allFlags;
}
Is this a support request? This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the code in this library. If you're not sure whether the problem you are having is specifically related to this library, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going here and clicking "submit a request", or by emailing support@launchdarkly.com.
Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.
Describe the bug React Native / Expo LDProvider causes errors in React Devtools and blocks possibility to use it in the Expo application.
To reproduce
Expected behavior No error thrown and it should be possible to use React Devtools without issues.
Logs If applicable, add any log output related to your problem.
SDK version
"@launchdarkly/react-native-client-sdk": "^10.0.3",
Language version, developer tools
OS/platform OS: macOS 14.5, details above
Additional context