oven-sh/bun · error · Error
blob.text() failed
Error message
blob.text() failed
What it means
Running a workspace pattern through the glob walker failed with an OS-level error; the pretty error printed alongside names the offending pattern and its errno (src/install/lockfile/Package/WorkspaceMap.rs:398-440 - walker creation, iterator init, and next-match all map to GlobError).
Source
Thrown at bench/snippets/blob.mjs:27
return small.text();
});
bench("blob.arrayBuffer(small string)", function () {
return small.arrayBuffer();
});
// if (Blob.prototype.json) {
// bench("blob.json(small string)", function () {
// return small.json();
// });
// }
bench("blob.slice()", function () {
return small.slice();
});
if ((await small.text()) !== JSON.stringify("hello world ")) {
throw new Error("blob.text() failed");
}
await run();
View on GitHub (pinned to 8c5296ac45)
Solutions
- Read the printed pattern + errno and fix or simplify that glob in package.json
- Fix filesystem permissions (or exclude) the directory the walk fails on
- Replace deep `**` patterns with explicit directory lists
- Test patterns with `new Bun.Glob(pattern).match(...)` before committing
Example fix
// before (package.json) "workspaces": ["**/*"] // after "workspaces": ["apps/*", "packages/*"]
Defensive patterns
Strategy: validation
Validate before calling
function workspacesGlobsResolve(globs) {
for (const pattern of globs) {
try {
const matches = [...new Bun.Glob(pattern).scanSync(".")];
if (matches.length === 0) console.warn(`pattern matches nothing: ${pattern}`);
} catch {
return false;
}
}
return true;
} Type guard
const isSimpleGlob = (p) => !/(\*\*.*\*\*|\[!|\{.*,.*\})/.test(p); Prevention
- Test new workspaces patterns with Bun.Glob before committing them
- Avoid deep recursive globs over directories with permission issues or symlink loops
- Fix directory permissions instead of letting the walker fail during install
When it happens
Trigger: A workspaces glob (from package.json `workspaces`/`workspaces.*` or bunfig) walking into an unreadable directory (EACCES), a path too long, a broken symlink loop, or a pattern the glob walker cannot process on your platform.
Common situations: Restrictive permissions on subdirectories (root-owned dirs inside the repo), exotic glob syntax copied from another tool, huge/deep `**` trees hitting OS limits.
Related errors
- not implemented right
- Mismatch
- Your package manager doesn't seem to support bun. To use bun
- FileNotFound
- AccessDenied
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/a4132779f89fca98.
Report an issue: GitHub.