Next.js Discord

Discord Forum

Error in POST Function

Answered
Transvaal lion posted this in #help-forum
Open in Discord
Transvaal lionOP
could anyone please check what I did wrong?
Answered by Kurilian Bobtail
Just use it prisma.query you already instantiated it in the client file
View full answer

27 Replies

check the console
@"use php" check the console
Transvaal lionOP
@"use php"
@Transvaal lion <@755810867878297610>
Yup, so run Prisma generate
Transvaal lionOP
@"use php" 🥲
Ya install it
Run the command
Transvaal lionOP
I did run the prisma client
@Transvaal lion <@755810867878297610> 🥲
There is a command in green
Run that
Transvaal lionOP
I did it and it is in the pic
npm i @prisma/client
and then I tried prisma generate
then
it should be installed
Transvaal lionOP
it show the error again
@Transvaal lion it show the error again
Havana
The issue is, that your PC has no clue what 'prisma' is, since its only installed in a local environment within the project, so you should include a script that will update the prisma from the inside.

In package.json:

"scripts": {
// dev, build scripts...
"updateprisma": "prisma generate"
},

Then run it using the package manager you use.
Transvaal lionOP
now I am facing this
@Transvaal lion now I am facing this
Havana
no, you should run
npm run updateprisma
Transvaal lionOP
I updated the client/prisma and it worked but now I face a problem with my new prisma(); which is in line number 5
Transvaal lionOP
@"use php" 😭
Someone experienced might help you better
Transvaal lionOP
so sorry for bothering 😭
Kurilian Bobtail
You are invoking prisma as a class that the problem
You need to use prisma client for queries
Kurilian Bobtail
Just use it prisma.query you already instantiated it in the client file
Answer
Transvaal lionOP
Thanks for the help @"use php" @Kurilian Bobtail @Havana ✨
Kurilian Bobtail
Sure man