zeckdude
zeckdude2mo ago

Clerk network call not occurring

I'm looking for help please. I have noticed that often times the call to https://balanced-dolphin-8.clerk.accounts.dev/v1/client/sessions/sess_2ojqFIajVEkL6pKY8eFNaAf5xQ4/tokens/convex?__clerk_api_version=2021-02-05&_clerk_js_version=5.33.0&__clerk_db_jwt=dvb_2ojqEK7D9C9qXRdB6uYdMQXSfSO doesn't happen and therefore database calls return undefined. I have no idea why it happens at times and at times it makes the call to get the database data. I'm on a next.js project. Here's my wrapper for my project:
'use client'
import dynamic from 'next/dynamic'
import { ToastContainer } from 'react-toastify'
import { NotificationProvider } from '@/context/useNotificationContext'
import type { ChildrenType } from '@/types/component'
import { ChatProvider } from '@/context/useChatContext'
import { ClerkProvider, useAuth } from '@clerk/nextjs'
import { ConvexProviderWithClerk } from 'convex/react-clerk'
import { ConvexReactClient } from 'convex/react'
import { SplashScreenWrapper } from './SplashScreenWrapper'

const LayoutProvider = dynamic(() => import('@/context/useLayoutContext').then((mod) => mod.LayoutProvider), { ssr: false })

const convex = new ConvexReactClient(process.env.NEXT_PUBLIC_CONVEX_URL!)

const AppProvidersWrapper = ({ children }: ChildrenType) => {
return (
<LayoutProvider>
<ClerkProvider publishableKey={process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY!}>
<ConvexProviderWithClerk client={convex} useAuth={useAuth}>
<SplashScreenWrapper>
<ChatProvider>
<NotificationProvider>
{children}
<ToastContainer theme="colored" />
</NotificationProvider>
</ChatProvider>
</SplashScreenWrapper>
</ConvexProviderWithClerk>
</ClerkProvider>
</LayoutProvider>
)
}

export default AppProvidersWrapper
'use client'
import dynamic from 'next/dynamic'
import { ToastContainer } from 'react-toastify'
import { NotificationProvider } from '@/context/useNotificationContext'
import type { ChildrenType } from '@/types/component'
import { ChatProvider } from '@/context/useChatContext'
import { ClerkProvider, useAuth } from '@clerk/nextjs'
import { ConvexProviderWithClerk } from 'convex/react-clerk'
import { ConvexReactClient } from 'convex/react'
import { SplashScreenWrapper } from './SplashScreenWrapper'

const LayoutProvider = dynamic(() => import('@/context/useLayoutContext').then((mod) => mod.LayoutProvider), { ssr: false })

const convex = new ConvexReactClient(process.env.NEXT_PUBLIC_CONVEX_URL!)

const AppProvidersWrapper = ({ children }: ChildrenType) => {
return (
<LayoutProvider>
<ClerkProvider publishableKey={process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY!}>
<ConvexProviderWithClerk client={convex} useAuth={useAuth}>
<SplashScreenWrapper>
<ChatProvider>
<NotificationProvider>
{children}
<ToastContainer theme="colored" />
</NotificationProvider>
</ChatProvider>
</SplashScreenWrapper>
</ConvexProviderWithClerk>
</ClerkProvider>
</LayoutProvider>
)
}

export default AppProvidersWrapper
1 Reply
ballingt
ballingt2mo ago
Could you open a support thread? This could take some back and forth.

Did you find this page helpful?