#Unhandled run time error
2 messages · Page 1 of 1 (latest)
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:
-
Check the full error stack trace. This can provide more detailed information about where and why the error is occurring.
-
Check the Network tab in your browser's developer tools. Look for any failed requests when the error occurs.
-
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.