prisma / prisma

Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
https://www.prisma.io
Apache License 2.0
39.55k stars 1.54k forks source link

Cannot find module '[...]/node_modules/@prisma/client/ultron' #23538

Open rodrigo4244 opened 7 months ago

rodrigo4244 commented 7 months ago

Bug description

I am getting the following error when I upgrade from Prisma v5.8.1 to v5.11.0 (I tried v5.9.1 and it failed too) and try to build my code:

image

Seems like import works for type checking but when building server side of pages using NextJS it throws "cannot find prisma client" module.

How to reproduce

Expected behavior

Build to complete with newest version

Prisma information

// Add your schema.prisma
datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["fullTextSearch"]
  output          = "../../../../node_modules/@prisma/client/ultron"
  binaryTargets   = env("PRISMA_BINARY_TARGET")
}
// Add your code using Prisma Client

Environment & setup

Prisma Version

Works:

prisma                  : 5.8.1
@prisma/client          : 5.8.1
Computed binaryTarget   : darwin-arm64
Operating System        : darwin
Architecture            : arm64
Node.js                 : v20.8.1
Query Engine (Node-API) : libquery-engine 78caf6feeaed953168c64e15a249c3e9a033ebe2 (at node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Schema Engine           : schema-engine-cli 78caf6feeaed953168c64e15a249c3e9a033ebe2 (at node_modules/@prisma/engines/schema-engine-darwin-arm64)
Schema Wasm             : @prisma/prisma-schema-wasm 5.8.1-1.78caf6feeaed953168c64e15a249c3e9a033ebe2
Default Engines Hash    : 78caf6feeaed953168c64e15a249c3e9a033ebe2
Studio                  : 0.497.0

Doesn't work:

prisma                  : 5.11.0
@prisma/client          : 5.11.0
Computed binaryTarget   : darwin-arm64
Operating System        : darwin
Architecture            : arm64
Node.js                 : v20.8.1
Query Engine (Node-API) : libquery-engine efd2449663b3d73d637ea1fd226bafbcf45b3102 (at node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Schema Engine           : schema-engine-cli efd2449663b3d73d637ea1fd226bafbcf45b3102 (at node_modules/@prisma/engines/schema-engine-darwin-arm64)
Schema Wasm             : @prisma/prisma-schema-wasm 5.11.0-15.efd2449663b3d73d637ea1fd226bafbcf45b3102
Default Engines Hash    : efd2449663b3d73d637ea1fd226bafbcf45b3102
Studio                  : 0.499.0
SevInf commented 7 months ago

Hi @rodrigo4244. Workaround for now is to change client location and not generate it into @prisma/client subfolder. Even if we manage to fix it in 5.x this is very likely will be a hard error in a future major version of the client.

rodrigo4244 commented 7 months ago

@SevInf Thanks for your reply, it makes sense that we generate the output of the client outside of node_modules/@prisma/client. Will try that at some point later in the week