Error: Unexpected type of undefined
In my
nextjs
app, I'm using preloadQuery
to load and render a query inside a Server Component
:
Then in my client component, I past the result into a usePreloadedQuery
.
I'm observing that every time the hook is called, an error is thrown on the next line. If I remove the hook then the app runs fine.
Below is a screenshot of the error reported at the very next line where the rendering starts.
Is this perhaps a well-known bug?
4 Replies
preloadQuery on the server should be
await
edNext.js Server Rendering | Convex Developer Hub
Next.js automatically renders both Client and Server Components on the server
😁 this is embarrassing...(spent half a day on this...) Thanks for the help
I think Next is missing the "promises should be awaited" ESLint rule in its default config 😦