Skip to content

Deploying prisma to CloudFlare pages using Nuxt/Nitro and node-postgres (pg) is using the wrong(vercel) wasm path #23500

@langleyd

Description

@langleyd

Bug description

Deploying prisma to CloudFlare pages using Nuxt/Nitro and node-postgres (pg) seems to be using the wrong wasm path as if the current runtime has been detected as vercel.

It also happpens locally when using nitro with the cloudflare-pages present

Error:

Building Nuxt Nitro server (preset: cloudflare_pages)                                                                          nitro 11:55:06 PM

[nitro 11:55:07 PM]  ERROR  Error: Could not load /Users/.../node_modules/.prisma/client/query_engine_bg.wasm?module (imported by node_modules/.prisma/client/wasm-edge-light-loader.js): ENOENT: no such file or directory, open '/Users/.../node_modules/.prisma/client/query_engine_bg.wasm?module'

How to reproduce

  1. Create a nuxt app with prisma
  2. Set the cloudflare preset nuxt.config.ts:
nitro: {
    preset: 'cloudflare-pages'
  },
  1. run npx nuxi build

Expected behavior

Cloudflare is not detected as edge-light runtime and loads the correct wasm.

Prisma information

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

Environment & setup

  • OS: macOS
  • Database: Postgre with adapter-pg

Prisma Version

5.11.0

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions