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

Registering 'error' event on ldClient does not suppress LaunchDarklyFlagFetchError #337

Open
twillzy opened this issue Dec 9, 2024 · 0 comments

Comments

@twillzy
Copy link

twillzy commented Dec 9, 2024

Describe the bug
I have followed the instructions here to suppress LaunchDarklyFlagFetchError but I am still getting the error logged in the console (and hence, Sentry).

To reproduce

const App = (props) => {
  const ldClient = useLDClient();
  useEffect(() => {
    if (!ldClient) return;
    ldClient.on('error', (e): void => {
      /* do nothing */
    });
  }, [ldClient]);

  return (
      <>My App</>
  );
};

export default withLDProvider({clientSideID: 'xxx'})(App);

Expected behavior
When ldClient encounters LaunchDarklyFlagFetchError in production, there should not be anything logged on console.

Logs
If applicable, add any log output related to your problem.

SDK version
"launchdarkly-react-client-sdk": "3.6.0",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant