Skip to content

[turbopack + prisma] TypeError: The "path" argument must be of type string. Received undefined #76497

@DiPSoMaNiE

Description

@DiPSoMaNiE

Link to the code that reproduces this issue

https://github.com/DiPSoMaNiE/next-canary-prisma-issue

To Reproduce

  1. Clone https://github.com/DiPSoMaNiE/next-canary-prisma-issue
  2. Run bun install
  3. Run prisma generate
  4. Run bun dev
  5. Go to http://localhost:3000 and see error

Current vs. Expected behavior

This error occurs when:

  • using next@15.2.0-canary.40 or above (works on 15.2.0-canary.39 and below)
  • using next dev --turbopack (works with next dev or next build which use webpack)
  • using custom output path in the generator block of schema.prisma

To make it work:

  1. Comment the output = "../generated" line in prisma/schema.prisma
  2. Run prisma generate
  3. Change import { PrismaClient } from '../generated' to import { PrismaClient } from '@prisma/client' in src/db.ts
  4. Run bun dev
  5. Go to http://localhost:3000 and see it works

Everything should work as expected with a custom output path for the generated PrismaClient.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:22 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 12
Binaries:
  Node: 22.14.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.2.0-canary.74 // Latest available version is detected (15.2.0-canary.74).
  eslint-config-next: 15.2.0-canary.74
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Turbopack

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

prisma                  : 6.4.1
@prisma/client          : 6.4.1
Computed binaryTarget   : darwin-arm64
Operating System        : darwin
Architecture            : arm64
Node.js                 : v22.14.0
TypeScript              : 5.7.3
Query Engine (Node-API) : libquery-engine a9055b89e58b4b5bfb59600785423b1db3d0e75d (at node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
Schema Engine           : schema-engine-cli a9055b89e58b4b5bfb59600785423b1db3d0e75d (at node_modules/@prisma/engines/schema-engine-darwin-arm64)
Schema Wasm             : @prisma/prisma-schema-wasm 6.4.0-29.a9055b89e58b4b5bfb59600785423b1db3d0e75d
Default Engines Hash    : a9055b89e58b4b5bfb59600785423b1db3d0e75d
Studio                  : 0.509.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    TurbopackRelated to Turbopack with Next.js.linear: turbopackConfirmed issue that is tracked by the Turbopack team.locked

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions