Skip to content

Prisma 6.0.0 client with commonjs crashes on Next.js #25761

@semoal

Description

@semoal

Bug description

After upgrading to 6.0.0, our Next.js with Prisma generated into a custom output folder crashes on dev mode.

The issue is caused by this pull-request : #25734 , Next.js talks about this error here: vercel/next.js#35110 (comment)

Screenshot 2024-12-01 at 16 36 09

The error is caused when we're using transpilePackages in next.config.js looks like it's also transpiling the prisma client to esm or something like that.

I've checked and removing type: commonjs works fine, so not sure how to fix it.

How to reproduce

Expected behavior

To not crash.

Prisma information

Prisma version: 6.0.0, with any prisma schema.

Environment & setup

  • OS: Mac
  • Database: Any
  • Node.js version: 22.11.0

Prisma Version

6.0.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions