oven-sh/bun · error · Error
expected one output
Error message
expected one output
What it means
Error "expected one output" thrown in oven-sh/bun.
Source
Thrown at src/codegen/bundle-functions.ts:317
useThis
? `function(${fn.params.join(",")})`
: `${fn.params.length === 1 ? fn.params[0] : `(${fn.params.join(",")})`}=>`
} {${fn.source}}).$$capture_end$$;
`,
);
await Bun.sleep(1);
const build = await Bun.build({
entrypoints: [tmpFile],
define,
target: "bun",
minify: { syntax: true, whitespace: false, keepNames: true },
});
// TODO: Wait a few versions before removing this
if (!build.success) {
throw new AggregateError(build.logs, "Failed bundling builtin function " + fn.name + " from " + basename + ".ts");
}
if (build.outputs.length !== 1) {
throw new Error("expected one output");
}
let output = (await build.outputs[0].text()).replaceAll("// @bun\n", "");
let usesDebug = output.includes("$debug_log");
let usesAssert = output.includes("$assert");
const captured = output.match(/\$\$capture_start\$\$([\s\S]+)\.\$\$capture_end\$\$/)![1];
const finalReplacement =
captured
.replace(
/function\s*\(.*?\)\s*{/,
'$&"use strict";' +
(usesDebug ? createLogClientJS("BUILTINS", fn.name) : "") +
(usesAssert ? createAssertClientJS(fn.name) : ""),
)
.replace(/^\((async )?function\(/, "($1function (")
.replace(/__intrinsic__/g, "@")
.replace(/__no_intrinsic__/g, "") + "\n";
const errors = [...finalReplacement.matchAll(/@bundleError\((.*)\)/g)];View on GitHub (pinned to 8c5296ac45)
When it happens
Trigger: Thrown at src/codegen/bundle-functions.ts:317 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/96d2d344a528ccc5.
Report an issue: GitHub.