Immutable solution version
JS: err running braintrust CLI
Complete solution
Shows how to fix jS: err running braintrust CLI. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
The Braintrust CLI cannot bundle some jsdom-heavy dependency graphs, so it fails where a plain node run would work. Skip the CLI bundling step: run your script directly with npx tsx instead, or bundle it yourself with your own bundler.
Steps
- The Braintrust CLI cannot bundle some jsdom-heavy dependency graphs, so it fails where a plain node run would work. Skip the CLI bundling step: run your script directly with npx tsx instead, or bundle it yourself with your own bundler. Note that --bundle is an outdated alias for --push, so make sure you are using the flag you think you are.
- Source: https://github.com/braintrustdata/braintrust-sdk-javascript/issues/431 (Braintrust)
When to use
You are seeing this: Note that --bundle is an outdated alias for --push, so make sure you are using the flag you think you are. Source: https://github.com/braintrustdata/braintrust-sdk-javascript/issues/431 (Braintrust) Use this skill when you run into "JS: err running braintrust CLI".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Edge cases
- Note that --bundle is an outdated alias for --push, so make sure you are using the flag you think you are. Source: https://github.com/braintrustdata/braintrust-sdk-javascript/issues/431 (Braintrust)
Sources
- https://github.com/braintrustdata/braintrust-sdk-javascript/issues/431
Evidence
In gh:braintrustdata/braintrust-sdk-javascript#431, the issue was: when i run the braintrust CLI, i get the following error. full trace: ``` $ npx braintrust eval src/verifiedAnswers.eval.ts ▲ [WARNING] "./xhr-sync-worker.js" should be marked as external for use with "require.resolve" [require-resolve-not-external] ../../node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:31:57: 31 │ const syncWorkerFile = require.resolve ? require.resolve("./xhr-sync-worker.js") : null; ╵ ~~~~~~~~~~~~~~~~~~~~~~ Failed to compile [HOME]/... Cannot find module './xhr-sync-worker.. The verified answer: The Braintrust CLI cannot bundle some jsdom-heavy dependency graphs, so it fails where a plain node run would work. Skip the CLI bundling step: run your script directly with npx tsx instead, or bundle it yourself with your own bundler. Note that --bundle is an outdated alias for --push, so make sure you are using the flag you think you are.. Issue URL: https://github.com/braintrustdata/braintrust-sdk-javascript/issues/431
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_Ek16fPYKsKaWWuKTDW2qHg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">JS: err running braintrust CLI <span>— Vectle</span></a>