prisma: Error after Upgrading from 5.8.1 to 5.9.0

Bug description

After upgrading the following error is shown:

Error: Cannot find module 'F:\XXX\XXX\backend\node_modules\@prisma\client\runtime\library'
    at createEsmNotFoundErr (node:internal/modules/cjs/loader:1060:15)
    at finalizeEsmResolution (node:internal/modules/cjs/loader:1053:15)
    at resolveExports (node:internal/modules/cjs/loader:538:14)
    at Function.Module._findPath (node:internal/modules/cjs/loader:607:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1025:27)
    at Function.Module._load (node:internal/modules/cjs/loader:885:27)
    at Module.require (node:internal/modules/cjs/loader:1105:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (F:\dev\ecence\backend\src\models\user\user.service.ts:7:1)
    at Module._compile (node:internal/modules/cjs/loader:1218:14)

How to reproduce

Expected behavior

Run Application. Works fine on 5.8.1.

I guess this error occurs because of the following line in our nestjs application:

import { PrismaClientKnownRequestError } from '@prisma/client/runtime/library';

Prisma information

// Add your schema.prisma
// Add your code using Prisma Client

Environment & setup

  • OS: Windows
  • Database: MySQL 8
  • Node.js version: 18.13.0

Prisma Version

v5.9.0

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Reactions: 14
  • Comments: 16 (8 by maintainers)

Most upvoted comments

https://github.com/prisma/prisma/releases/tag/5.9.1 is now available with the fix ✨

Please create a new issue if you find a bug.

edit: sorry i miss typed 5.9.0 sorry Yes i’m just installing it i’ll update my answer once i test it

Update: version 5.10.0-integration-fix-client-exports-map.10 is working fine 🥳🥳

I can confirm that 5.9.1 resolves the issue my side - thanks for the quick fix!

Hey, can you please import it from @prisma/client? I am asking you this because you are importing an internal implementation.

import { Prisma } from '@prisma/client'

Prisma.PrismaClientKnownRequestError

We are working on the release as we speak, I will keep you updated.

@wassimbj 5.9.1 is not released yet (stay tuned)

Did you try 5.10.0-integration-fix-client-exports-map.10 or 5.10.0-integration-fix-client-exports-map.11 already?

After upgrading to 5.9.0 today I started to have issues with my generated types, after renaming a column name and running a migration. I had to rollback… =/