Property 'prisma' does not exist on type 'object'
#0 9.578 Failed to compile.
#0 9.578
#0 9.578 ./src/server/api/routers/example.ts:19:16
#0 9.578 Type error: Property 'prisma' does not exist on type 'object'.
#0 9.578
#0 9.578 17 |
#0 9.578 18 | getAll: publicProcedure.query(({ ctx }) => {
#0 9.578 > 19 | return ctx.prisma.example.findMany();
#0 9.578 | ^
#0 9.578 20 | }),
#0 9.578 21 |
#0 9.578 22 | getSecretMessage: protectedProcedure.query(() => {
#0 10.15 npm notice
#0 10.15 npm notice New major version of npm available! 8.1.0 -> 9.6.6
#0 10.15 npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.6.6
#0 10.15 npm notice Run npm install -g [email protected] to update!
#0 10.15 npm notice
------
failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1
make: *** [run] Error 17
i get this error when building, this is from the boilerplate after generating pls help
7 Replies
generated boilerplate
same here
Did you ever figure this out? I have this issue now when following the t3 chirp tutorial. Any suggestions?
I did figure it out, you may find this GitHub repository helpful. Additionally remember that this is trpc10
https://github.com/julilan/t3-chirp
GitHub
GitHub - julilan/t3-chirp: Repository for a Emoji Twitter clone mad...
Repository for a Emoji Twitter clone made with T3 App. - GitHub - julilan/t3-chirp: Repository for a Emoji Twitter clone made with T3 App.
I solved this by using ctx.db. instead of ctx.prisma. Hope this helps. Took me far too many hours of struggling.
Like this
return ctx.db.post.findMany();