Prisma client won't generate and reports mismatch after upgrade to v4.5.0
See original GitHub issueBug description
I was updating packages,
I updated Prisma from v4.4.0 -> v4.5.0
Then, I used prisma generate
and the generated client stopped working, and it says there is a prisma version mismatch (prisma = 4.5.0 vs @prisma/client = 4.4.0, even though when I run prisma --version it shows both are at 4.5.0).
I tried clearing my node modules and reinstalling, but after that didn’t work I tried clearing my pnpm store and reinstalling, but that didn’t work either.
I tried downgrading to v4.4.0, which didn’t work either.
I’m running a turbo repo and cleared the node_modules in all locations, and reinstalled using the above method.
How to reproduce
- use
pnpm prisma generate
after updating from 4.4.0 - attempt to import types or make queries
- see error image
Expected behavior
Prisma client is generated correctly and able to be used.
Prisma information
Environment & setup
- OS: Fedora
- Database: MySQL (planetscale)
- Node.js version: v16.14.0
Prisma Version
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Type mismatch issue after upgrading TypeScript from 4.1.5 to ...
5, everything is working as expected but as soon as I update TS version to 4.2.4 and compile the code, I am getting...
Read more >Upgrade to Prisma 4
Prisma 4 introduces a number of breaking changes when you upgrade from an earlier Prisma version. This guide explains how this upgrade might...
Read more >Error message reference - Prisma
Prisma Client throws a PrismaClientUnknownRequestError exception if the query engine returns an error related to a request that does not have an error...
Read more >Prisma Client API (Reference)
Prisma Client uses a database upsert for an upsert query when the query meets the following criteria: There are no nested queries in...
Read more >Upgrading versions (Guides) - Prisma
Upgrade your codebase where applicable. Breaking changes may require you to change your Prisma schema or the way you use Prisma Client.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Having the same issue with NPM on a turborepo. Had to clean cache, remove all node_modules folders, pin
4.4.0
version and removed any reference to prisma from the package-lock to make it work.Apparently 4.5.0 is installing under the package’s node_module folder as oppose to 4.4.0 that installs under the root node_modules.
If I just change to
4.4.0
on the package.json, it somehow keeps installing the4.5.0
because there’s still some reference on the package-lock to it.Hi @macklinhrw This is weird 🤔 Which version of pnpm are you using? What are the entries for
prisma
and@prisma/client
in your package.json?