Provide environment information
System:
OS: macOS 15.1
CPU: (11) arm64 Apple M3 Pro
Memory: 133.08 MB / 18.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.18.0 - /opt/homebrew/opt/node@20/bin/node
npm: 10.8.2 - /opt/homebrew/opt/node@20/bin/npm
pnpm: 9.12.3 - /opt/homebrew/opt/node@20/bin/pnpm
Describe the bug
Running pnpm dlx trigger.dev@latest deploy fails when using prismaExtension's default config.
Based on this doc, the prismaExtension should automatically detect the installed version. Without a version, the deployment succeeds and silently reports an error:
% pnpm trigger deploy
Trigger.dev (3.2.0)
------------------------------------------------------
┌ Deploying project
│
◇ Retrieved your account details for ...
│
◇ Successfully built project
✘ [ERROR] Failed to apply extension PrismaExtension onBuildComplete Error: PrismaExtension could not determine the version of @prisma/client. It's possible that the @prisma/client was not used in the project. If this isn't the case, please provide a version in the PrismaExtension options.
at PrismaExtension.onBuildComplete
(/Users/guillaume/alephic/trigger-prisma-bug/node_modules/.pnpm/@trigger.dev+build@3.2.0_typescript@5.6.3/node_modules/@trigger.dev/build/dist/commonjs/extensions/prisma.js:55:19)
at notifyExtensionOnBuildComplete
(file:///Users/guillaume/alephic/trigger-prisma-bug/node_modules/.pnpm/trigger.dev@3.2.0_typescript@5.6.3/node_modules/trigger.dev/dist/esm/build/extensions.js:16:33)
at async buildWorker
(file:///Users/guillaume/alephic/trigger-prisma-bug/node_modules/.pnpm/trigger.dev@3.2.0_typescript@5.6.3/node_modules/trigger.dev/dist/esm/build/buildWorker.js:70:21)
at async _deployCommand
(file:///Users/guillaume/alephic/trigger-prisma-bug/node_modules/.pnpm/trigger.dev@3.2.0_typescript@5.6.3/node_modules/trigger.dev/dist/esm/commands/deploy.js:120:27)
at async
file:///Users/guillaume/alephic/trigger-prisma-bug/node_modules/.pnpm/trigger.dev@3.2.0_typescript@5.6.3/node_modules/trigger.dev/dist/esm/commands/deploy.js:77:16
at async
file:///Users/guillaume/alephic/trigger-prisma-bug/node_modules/.pnpm/trigger.dev@3.2.0_typescript@5.6.3/node_modules/trigger.dev/dist/esm/cli/common.js:54:28
at async wrapCommandAction
(file:///Users/guillaume/alephic/trigger-prisma-bug/node_modules/.pnpm/trigger.dev@3.2.0_typescript@5.6.3/node_modules/trigger.dev/dist/esm/cli/common.js:40:12)
at async deployCommand
(file:///Users/guillaume/alephic/trigger-prisma-bug/node_modules/.pnpm/trigger.dev@3.2.0_typescript@5.6.3/node_modules/trigger.dev/dist/esm/commands/deploy.js:76:12)
at async
file:///Users/guillaume/alephic/trigger-prisma-bug/node_modules/.pnpm/trigger.dev@3.2.0_typescript@5.6.3/node_modules/trigger.dev/dist/esm/commands/deploy.js:71:13
at async handleTelemetry
(file:///Users/guillaume/alephic/trigger-prisma-bug/node_modules/.pnpm/trigger.dev@3.2.0_typescript@5.6.3/node_modules/trigger.dev/dist/esm/cli/common.js:30:9)
at async Command.<anonymous>
(file:///Users/guillaume/alephic/trigger-prisma-bug/node_modules/.pnpm/trigger.dev@3.2.0_typescript@5.6.3/node_modules/trigger.dev/dist/esm/commands/deploy.js:69:9)
at async Command.parseAsync
(/Users/guillaume/alephic/trigger-prisma-bug/node_modules/.pnpm/commander@9.5.0/node_modules/commander/lib/command.js:935:5)
at async main
(file:///Users/guillaume/alephic/trigger-prisma-bug/node_modules/.pnpm/trigger.dev@3.2.0_typescript@5.6.3/node_modules/trigger.dev/dist/esm/index.js:5:5)
│
◇ Successfully deployed version 20241117.8
│
└ Version 20241117.8 deployed with 1 detected task
When adding version: "5.22.0", the deployment fails entirely:
% pnpm trigger deploy
Trigger.dev (3.2.0)
------------------------------------------------------
┌ Deploying project
│
◇ Retrieved your account details for ...
│
◇ Successfully built project
▲ [WARNING] prismaExtension could not resolve the DATABASE_URL environment variable. Make sure you add it to your environment variables. See our docs for more info: https://trigger.dev/docs/deploy-environment-variables
│
◇ Failed to deploy project
│
└ Error: Error building image. Full build logs have been saved to /var/folders/4j/sp9fwh5s369b28x_jjckbgd40000gn/T/trigger-Z2WsDu/build-gwivrttk.log
Here's a snippet of the build error:
------
> [build 6/7] RUN node node_modules/prisma/build/index.js generate --schema=./prisma/schema.prisma:
#17 0.456 Prisma schema loaded from prisma/schema.prisma
#17 0.579 Error: Command failed with ENOENT: pnpm add @prisma/client@5.22.0 --silent
#17 0.579 spawn pnpm ENOENT
------
Error: failed to solve: process "/bin/sh -c node node_modules/prisma/build/index.js generate --schema=./prisma/schema.prisma" did not complete successfully: exit code: 1
Workaround
Adding "@prisma/client" to additionalPackages fixes the issue:
import { defineConfig } from "@trigger.dev/sdk/v3";
import { additionalPackages } from "@trigger.dev/build/extensions/core";
import { prismaExtension } from "@trigger.dev/build/extensions/prisma";
export default defineConfig({
build: {
extensions: [
prismaExtension({ schema: "prisma/schema.prisma" }),
additionalPackages({ packages: ["@prisma/client@5.22.0"] }),
]
}
})
Reproduction repo
https://github.com/gmathieu/trigger-prisma-bug
To reproduce
Note: Don't worry about DATABASE_URL warnings, we're only testing the deployment cycle.
Scenario 1: silent failure
Scenario 2: build failure with version
Scenario 3: successful deployment with additionalPackages
Note: additionalPackages properly populates the manifest's externals here, so version can be omitted.
Additional information
No response
Provide environment information
System:
OS: macOS 15.1
CPU: (11) arm64 Apple M3 Pro
Memory: 133.08 MB / 18.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.18.0 - /opt/homebrew/opt/node@20/bin/node
npm: 10.8.2 - /opt/homebrew/opt/node@20/bin/npm
pnpm: 9.12.3 - /opt/homebrew/opt/node@20/bin/pnpm
Describe the bug
Running
pnpm dlx trigger.dev@latest deployfails when usingprismaExtension's default config.Based on this doc, the
prismaExtensionshould automatically detect the installed version. Without aversion, the deployment succeeds and silently reports an error:When adding
version: "5.22.0", the deployment fails entirely:Here's a snippet of the build error:
Workaround
Adding "@prisma/client" to
additionalPackagesfixes the issue:Reproduction repo
https://github.com/gmathieu/trigger-prisma-bug
To reproduce
pnpm installprojectwith your project ID intrigger.config.tsNote: Don't worry about
DATABASE_URLwarnings, we're only testing the deployment cycle.Scenario 1: silent failure
pnpm trigger deployScenario 2: build failure with version
pnpm trigger deployScenario 3: successful deployment with
additionalPackagespnpm trigger deployNote:
additionalPackagesproperly populates the manifest's externals here, so version can be omitted.Additional information
No response