trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

bug: Prisma generate with typedSql fails during trigger.dev deployment with "Unknown type" error

Open the-dream-machine opened this issue 6 months ago • 1 comments

Provide environment information

System: OS: macOS 15.5 CPU: (8) arm64 Apple M1 Memory: 135.39 MB / 8.00 GB Shell: 5.9 - /bin/zsh

Binaries: Node: 24.3.0 - ~/.nvm/versions/node/v24.3.0/bin/node Yarn: 1.22.22 - ~/.volta/bin/yarn npm: 11.4.2 - ~/.nvm/versions/node/v24.3.0/bin/npm pnpm: 8.15.5 - ~/.volta/bin/pnpm bun: 1.2.18 - ~/.bun/bin/bun

Describe the bug

When deploying a trigger.dev project with Prisma schema using the typedSql preview feature, the build fails during the Prisma generate step with an "Unknown type" error. The error does not occur in local development.

Error logs

#18 [build 6/7] RUN node node_modules/prisma/build/index.js generate --schema=./prisma/schema.prisma --sql
#18 1.132 Prisma schema loaded from prisma/schema.prisma
#18 4.024 Error:
#18 4.024 Unknown type
#18 4.024
#18 4.024
#18 ERROR: process "/bin/sh -c node node_modules/prisma/build/index.js generate --schema=./prisma/schema.prisma --sql" did not complete successfully: exit code: 1

Package versions

  • trigger.dev: 3.3.17
  • Prisma: 6.11.1
  • @prisma/client: 6.11.1

Reproduction repo

null

To reproduce

trigger.config.ts

export default defineConfig({
  project: 'my_project_id',
  machine: 'micro',
  build: {
    extensions: [
      prismaExtension({
        typedSql: true,
        schema: 'prisma/schema.prisma',
        directUrlEnvVarName: 'DIRECT_DATABASE_URL',
      }),

      // ... other extensions
    ],
  }
})

package.json (relevant sections)

{
  "prisma": {
    "schema": "prisma",
    "seed": "bun prisma/seed.ts"
  },
}

prisma/schema.prisma

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["typedSql"]
}

datasource db {
  provider  = "postgresql"
  url       = env("DATABASE_URL")
  directUrl = env("DIRECT_DATABASE_URL")
}

Prisma folder structure

prisma/
├── schema.prisma
├── seed.ts
├── migrations/
├── sql/
├── model.prisma
...other prisma model files

Steps to Reproduce

  1. Create a trigger.dev project with Prisma extension using typedSql: true
  2. Use a multi-file Prisma schema structure (schema split across multiple files)
  3. Include SQL files in prisma/sql/ directory
  4. Run bunx [email protected] deploy
  5. Build fails during Prisma generate step

Additional information

The project uses a multi-file Prisma schema structure where models are split across separate .prisma files

the-dream-machine avatar Jul 09 '25 04:07 the-dream-machine

Hi! I'd like to work on this issue. I will investigate it and will update my progress here.

omkardongre avatar Aug 29 '25 07:08 omkardongre