PrismaP
Prisma4mo ago
9 replies
Marius Nowak

Unexpected "export *" warning with Prisma 6.16 in monorepo setup

Hello 👋

I’m working in a monorepo with Prisma (v6.16.0) and since updating, my dev server is spammed with the following warning:
unexpected export *
export * used with module [project]/packages/database/generated/client.js [app-route] (ecmascript) 
which is a CommonJS module with exports only available at runtime

List all export names manually (`export { a, b, c } from "..."`) or rewrite the module to ESM, 
to avoid the additional runtime code.


Repository setup

- Monorepo with Turborepo
- Structure :
.
├── apps
│   └── vdee
├── packages
│   ├── database
│   │   ├── prisma/schema.prisma
│   │   ├── index.ts
│   │   └── package.json
│   └── my-zod
├── turbo.json
├── package.json
└── yarn.lock

- schema.prisma (packages/database/prisma/schema.prisma):
generator client {
  provider     = "prisma-client-js"
  moduleFormat = "esm"
}

datasource db {
  provider     = "mysql"
  url          = env("DATABASE_URL")
  relationMode = "prisma"
}

- packages/database/index.ts:
export { Client } from "@planetscale/database";
export { PrismaPlanetScale } from "@prisma/adapter-planetscale";

// Re-exports from Prisma
export * from "./generated";
export * from "./generated/client";
export * from "./generated/runtime/index-browser";

- Example usage:
import { Prisma, ApproachTypeEnum } from "database";
Was this page helpful?