bug: Prisma generate with typedSql fails during trigger.dev deployment with "Unknown type" error
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
- Create a trigger.dev project with Prisma extension using
typedSql: true - Use a multi-file Prisma schema structure (schema split across multiple files)
- Include SQL files in
prisma/sql/directory - Run
bunx [email protected] deploy - 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
Hi! I'd like to work on this issue. I will investigate it and will update my progress here.