Skip to content

@prisma/nextjs-monorepo-workaround-plugin is not able to handle multiple clients #18069

@millsp

Description

@millsp

Bug description

@prisma/nextjs-monorepo-workaround-plugin is not able to handle multiple generated clients in a monorepo setup, which are then most commonly bundled together via a Next.js app. The current logic poorly attempts to manage multiple schemas, and thus ends up updating the paths to only one schema across all the bundled clients. This obviously does not work and leads to various errors depending on how much the two schemas differ.

#12853 (comment)
#12921 (comment)
#17687 (comment)
#17687 (comment)

How to reproduce

https://github.com/trentonsnyder/nextjs-prisma-repro (thanks @trentonsnyder)

Expected behavior

Multiple schemas can be handled without any issue when multiple clients are bundled.

Prisma information

n/a

Environment & setup

  • OS: n/a
  • Database: n/a
  • Node.js version: n/a

Prisma Version

4.11.0-dev

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions