Dhruv Kumar Jha
Dhruv Kumar Jha8mo ago

How to get preloaded data on the server

Hi Guys, I am back with another question. This is related to Preloading Data https://docs.convex.dev/api/modules/nextjs#preloading-data I followed it, it's working. however I am not sure if its working as its supposed to be. In my next js app, layout.ts file, I call preloadQuery to load the query In the same file, I am using ChildComponent and passing the preloaded query to it and in the Child Component (client component) I am calling usePreloadedQuery and it works**. The issue is when I console log the preloaded query in server component (layout.ts file) it just displays
preloaded {
_name: 'backend:getInitialData',
_argsJSON: {},
_valueJSON: {}
}
preloaded {
_name: 'backend:getInitialData',
_argsJSON: {},
_valueJSON: {}
}
Is this how its supposed to work or am I missing something? I don't see any actuald data here. FYI: The query is called outside the ConvexProviderWithClerk
Module: nextjs | Convex Developer Hub
Helpers for integrating Convex into Next.js applications using server rendering.
1 Reply

Did you find this page helpful?