question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prisma client won't generate and reports mismatch after upgrade to v4.5.0

See original GitHub issue

Bug 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

  1. use pnpm prisma generate after updating from 4.4.0
  2. attempt to import types or make queries
  3. see error image

Expected behavior

Prisma client is generated correctly and able to be used.

Prisma information

image

image

Environment & setup

  • OS: Fedora
  • Database: MySQL (planetscale)
  • Node.js version: v16.14.0

Prisma Version

image

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
wladistoncommented, Oct 22, 2022

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 the 4.5.0 because there’s still some reference on the package-lock to it.

3reactions
Jolg42commented, Oct 21, 2022

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found