From 82bac88e9a6237d0486ef294f017fee058e4d540 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Wed, 22 Apr 2026 15:26:27 +0200 Subject: [PATCH 1/2] fix(auto-instrumentation): Skip over file transforms in bundler plugins when `id` is undefined --- js/src/auto-instrumentations/bundler/plugin.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/src/auto-instrumentations/bundler/plugin.ts b/js/src/auto-instrumentations/bundler/plugin.ts index 508bb8ae3..b9097da99 100644 --- a/js/src/auto-instrumentations/bundler/plugin.ts +++ b/js/src/auto-instrumentations/bundler/plugin.ts @@ -94,6 +94,11 @@ export const unplugin = createUnplugin((options = {}) => { name: "code-transformer", enforce: "pre", transform(code: string, id: string) { + if (!id) { + // Some modules apparently don't have an id? + return null; + } + // Convert file:// URLs to regular paths at entry point // Node.js ESM loader hooks provide file:// URLs, but downstream code expects paths const filePath = id.startsWith("file:") ? fileURLToPath(id) : id; From 933d664e912640a6587fa44eddd9189df6662423 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Wed, 22 Apr 2026 15:28:20 +0200 Subject: [PATCH 2/2] changeset --- .changeset/chilly-sites-greet.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/chilly-sites-greet.md diff --git a/.changeset/chilly-sites-greet.md b/.changeset/chilly-sites-greet.md new file mode 100644 index 000000000..0b766015b --- /dev/null +++ b/.changeset/chilly-sites-greet.md @@ -0,0 +1,5 @@ +--- +"braintrust": patch +--- + +fix(auto-instrumentation): Skip over file transforms in bundler plugins when id is undefined