#Unhandled run time error

2 messages · Page 1 of 1 (latest)

sour juncoBOT
#

Hi @autumn kite. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Hmm, I don't know enough to give you a confident answer yet. However, based on the knowledge sources provided, there are a few steps you can take to debug an unhandled runtime error:

  1. Check the full error stack trace. This can provide more detailed information about where and why the error is occurring.

  2. Check the Network tab in your browser's developer tools. Look for any failed requests when the error occurs.

  3. If you're using Convex and Clerk, ensure that your Convex client is not being redeclared inside a React component. This can cause issues as it would create a new Convex client every time the component renders.

Here's an example of how to correctly declare your Convex client:

const convex = new ConvexReactClient(env.NEXT_PUBLIC_CONVEX_URL);

const ServicesProvider: React.FC<React.PropsWithChildren> = ({ children }) => {
  const { resolvedTheme } = useTheme();
  return (
    <ClerkProvider
      signInFallbackRedirectUrl="/sign-in"
      signUpFallbackRedirectUrl="/sign-up"
      afterSignOutUrl="/sign-in"
      appearance={{
        baseTheme: resolvedTheme === "dark" ? darkThemeClerk : undefined,
        variables: {
          colorPrimary: "hsl(263.4, 70%, 50.4%)",
        },
      }}
    >
      <ConvexProviderWithClerk client={convex} useAuth={useAuth}>
        {children}
      </ConvexProviderWithClerk>
    </ClerkProvider>
  );
};

If you're still having trouble, it would be helpful to see more details about your code and the specific error message you're receiving.

Sources: Discord support thread: Convex+Clerk: sign out unhandled runtime error (https://discord.com/channels/1019350475847499849/1239847310222168114)

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: