Weird bug? Can't import {PrismaClient} from @prisma/client
The problem is only with typescript I guess, because the code I wrote works perfectly.
pic 1 - my schema
pic 2 - db.ts
pic 3 - api/hello.ts
pic 4 - api/hello response
Note: I created a few instances of Example model using prisma studio.
Note 2 : Project created with prisma + tailwind + pnpm + @/* + typescript
![](https://utfs.io/f/683c55d5-9e9e-4a8c-8112-e4c3b283d8d2-1nq2cb.png)
![](https://utfs.io/f/d291c836-d991-42ec-8c35-c2911c46d391-1nq2cb.png)
![](https://utfs.io/f/a4fd925c-7e1e-489b-8905-8af6e16ef2c8-1nq2cb.png)
![](https://utfs.io/f/52027923-a750-4ea8-8678-c5861e59d5ed-1nq2cb.png)
Solution:Jump to solution
I updated my IDE(PyCharm - same thing as webstorm but with python support) from 2022.2 to 2023.1, and the bug is no more present
12 Replies
Restarting PyCharm(WebStorm) didn't help.
Restarting Typescript service didn't help.
The repo link: https://github.com/yatochka-dev/yatochka
GitHub
GitHub - yatochka-dev/yatochka
Contribute to yatochka-dev/yatochka development by creating an account on GitHub.
seems like you forgot to run
pnpm prisma generate
I did that many times already, and tried to do it one more time rn.
Didn't work.
I cloned your repo, did
pnpm install
and pnpm prisma generate
and there is no errorI did the same thing now, and there's still an issue
maybe some dependency issue, try deleting node_modules and reinstall everything with npm
Still the same thing.
![](https://utfs.io/f/899aa43f-9416-4584-b013-9469d6a2d9a7-1nq2cb.png)
I tried opening the same project in VS code, everything seems to work fine:
![](https://utfs.io/f/b25ff058-e5d9-4f31-a396-c2b9f057a9fd-1nq2cb.png)
Okay, that's very weird
Solution
I updated my IDE(PyCharm - same thing as webstorm but with python support) from 2022.2 to 2023.1, and the bug is no more present
TYPPEESS
![](https://utfs.io/f/3c0e6924-d210-4a88-811a-4f2161a3bd00-1nq2cb.png)