Skip to content

@tsed/prisma@8.40.0 + Prisma's prisma-client generator: invalid JS in internal/class.js when a tsconfig.json is present #3462

Description

@Hoegsgaard

Following up on #3453, thank you for the work on this. I ran into an issue trying to switch schema.prisma's client generator from prisma-client-js to prisma-client.

Reproduction

generator client {
  provider = "prisma-client"
  output   = "../generated/prisma"
}

generator tsed {
  provider           = "tsed-prisma"
  output             = "../generated/tsed"
  emitTranspiledCode = true
}

datasource db {
  provider = "postgresql"
}

model User {
  id    String @id @default(uuid())
  email String @unique
}

With a tsconfig.json present in the project root and DATABASE_URL set to any syntactically valid connection string, npx prisma generate completes without error, but the resulting generated/prisma/internal/class.js contains invalid JavaScript:

get;
user();
Prisma.UserDelegate();

The corresponding .ts source is correct:

get user(): Prisma.UserDelegate<ExtArgs, { omit: OmitOpts }>;

This is an interface-only member with no implementation. Whatever compiles it to .js strips the type annotations without recognizing the whole declaration should be dropped, leaving three broken statement fragments instead.

Tested, to narrow it down:

  • Only reproduces when both the generator tsed block and a tsconfig.json are present together. Neither alone triggers it.
  • Reproduces on prisma/@prisma/client@7.3.0 (same version as packages/orm/prisma/test/prisma-client uses) and on 7.10.0.

Environment

  • prisma / @prisma/client: tested on 7.3.0 and 7.10.0
  • @tsed/prisma: 8.40.0
  • Node 22

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions