Next.js Discord

Discord Forum

Following "How to Build a Fullstack App with Next.js, Prisma, and Vercel Postgres" doesn't work.

Unanswered
DI INSONNIA posted this in #help-forum
Open in Discord
Avatar
DI INSONNIAOP
I'm getting the error...

Error: Objects are not valid as a React child (found: [object Promise]). If you meant to render a collection of children, use an array instead.


My project is: https://github.com/gllrmzndm/Forza-Motorsport-Autovista

9 Replies

Avatar
DI INSONNIAOP
I have no idea what to do..
This what I'm getting too,

Cannot find module './lib/prisma' or its corresponding type declarations.ts(2307)
Image
Avatar
Southern rough shrimp
the import should be ../lib/prisma because you need to go back 1 directory
Where specifically in the code is the error? There's no use posting an entire project.
Avatar
DI INSONNIAOP
My project is slightly different than the manual and I think the manual works, but not in my instance, since I didn't use the project from the beginning.

I'm going to do the project and add things later myself.
I cannot delete the post or mark it as a solution
Avatar
Southern rough shrimp
Mark it as not enough info
Or just show the code so I can help
Avatar
Tonkinese
Bud you're returning the function that's meant to get the data you need, but not anything for the UI to actually handle it. It also looks like your import is pointing to the wrong place. The prisma you're looking for doesn't come from the actual prisma folder, it comes from the node_modules folder... just change that import to '@prisma/client'... Then add a function for literally anything that can render a react element. Something like const MyComponent = ({props}: {props: any}) => <div>{props}</div>.