Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prisma (v5.12 & v5.14 & v5.15) client has errors accessing cockroachdb when using with cloudflare workers and the new driverAdapter preview feature #24475

Open
alexdoan102 opened this issue Jun 8, 2024 · 0 comments
Labels
bug/2-confirmed Bug has been reproduced and confirmed. domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. kind/bug A reported bug. topic: cockroachdb topic: driverAdapters topic: prisma generate CLI: prisma generate

Comments

@alexdoan102
Copy link

Bug description

Bug description

Prisma (v5.12 & v5.14 & v5.15 client has errors accessing cockroachdb when using with cloudflare workers and the new { previewFeatures = ["driverAdapters"] }. All queries using the PrismaClient() will fail with error:

Cannot find module './query_engine_bg.js'

Image

NOTE: the root cause of the bug is that there are 2 files: [query_engine_bg.js] & [query_engine_bg.wasm] that are missing from the directory [\node_modules.prisma\client]

(if you copy the 2 missing files into this directory, then the PrismaClient() will work, and be able to query the database)

How to reproduce

You can use your own example:
https://github.com/prisma/ecosystem-tests/tree/dev/driver-adapters-wasm/pg-cf-basic

change the provider to "cockroachdb", and the 2 missing files will not get produced (in the .prisma/client directory)

image

Expected behavior

the 2 file below should appear in the direcotry .[..\pg-cf-basic\node_modules.prisma\client]

query_engine_bg.js
query_engine_bg.wasm

Prisma information

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

Environment & setup

  • OS: windows 10
  • Database: [PostgreSQL]
  • Node.js version: v18.16.0

Prisma Version

prisma 5.12.1   (or 51.4 or 5.15)
@prisma/client 5.12.1   (or 51.4 or 5.15)
@prisma/adapter-pg  5.12.1   (or 51.4 or 5.15)
@alexdoan102 alexdoan102 added the kind/bug A reported bug. label Jun 8, 2024
@janpio janpio added bug/2-confirmed Bug has been reproduced and confirmed. domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. topic: cockroachdb topic: driverAdapters topic: prisma generate CLI: prisma generate labels Jun 8, 2024
@janpio janpio changed the title Prisma (v5.12 & v5.14 & v5.15) client has errors accessing cockroachdb when using with cloudflare workers and the new { previewFeatures = ["driverAdapters"] Prisma (v5.12 & v5.14 & v5.15) client has errors accessing cockroachdb when using with cloudflare workers and the new driverAdapter preview feature Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. kind/bug A reported bug. topic: cockroachdb topic: driverAdapters topic: prisma generate CLI: prisma generate
Projects
None yet
Development

No branches or pull requests

2 participants