From feb4fcdac675aa6c18fde4b0a96e87abc80102e2 Mon Sep 17 00:00:00 2001
From: nicktrn <55853254+nicktrn@users.noreply.github.com>
Date: Mon, 14 Oct 2024 18:00:10 +0100
Subject: [PATCH] Fix bun runtime by downgrading to 1.1.24 (#1409)
* pin bun to 1.1.24 and use slim image
* add changeset
* add warning about bun version to docs
---
.changeset/wicked-paws-accept.md | 5 +++++
docs/guides/frameworks/bun.mdx | 2 ++
packages/cli-v3/src/deploy/buildImage.ts | 2 +-
3 files changed, 8 insertions(+), 1 deletion(-)
create mode 100644 .changeset/wicked-paws-accept.md
diff --git a/.changeset/wicked-paws-accept.md b/.changeset/wicked-paws-accept.md
new file mode 100644
index 000000000..75b3ea94e
--- /dev/null
+++ b/.changeset/wicked-paws-accept.md
@@ -0,0 +1,5 @@
+---
+"trigger.dev": patch
+---
+
+Fix an IPC bug when using bun by pinning to an older version.
diff --git a/docs/guides/frameworks/bun.mdx b/docs/guides/frameworks/bun.mdx
index 8efea3f4d..380ebcdc1 100644
--- a/docs/guides/frameworks/bun.mdx
+++ b/docs/guides/frameworks/bun.mdx
@@ -9,6 +9,8 @@ import Prerequisites from "/snippets/framework-prerequisites.mdx";
import CliRunTestStep from "/snippets/step-run-test.mdx";
import CliViewRunStep from "/snippets/step-view-run.mdx";
+A specific Bun version is currently required for the dev command to work. This is due to a [bug](https://github.com/oven-sh/bun/issues/13799) with IPC. Please use Bun version 1.1.24 or lower: `curl -fsSL https://bun.sh/install | bash -s -- bun-v1.1.24`
+
We now have experimental support for Bun. This guide will show you have to setup Trigger.dev in your existing Bun project, test an example task, and view the run.
diff --git a/packages/cli-v3/src/deploy/buildImage.ts b/packages/cli-v3/src/deploy/buildImage.ts
index 5a53e30f1..6e00ccaa8 100644
--- a/packages/cli-v3/src/deploy/buildImage.ts
+++ b/packages/cli-v3/src/deploy/buildImage.ts
@@ -464,7 +464,7 @@ async function generateBunContainerfile(options: GenerateContainerfileOptions) {
);
return `# syntax=docker/dockerfile:1
-FROM imbios/bun-node:22-debian AS base
+FROM imbios/bun-node:1.1.24-22-slim@sha256:9cfb7cd87529261c482fe17d8894c0986263f3a5ccf84ad65c00ec0e1ed539c6 AS base
${baseInstructions}