{"record":{"id":"a4132779f89fca98","repo":"oven-sh/bun","slug":"blob-text-failed","errorCode":null,"errorMessage":"blob.text() failed","messagePattern":"blob\\.text\\(\\) failed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"bench/snippets/blob.mjs","lineNumber":27,"sourceCode":"  return small.text();\n});\n\nbench(\"blob.arrayBuffer(small string)\", function () {\n  return small.arrayBuffer();\n});\n\n// if (Blob.prototype.json) {\n//   bench(\"blob.json(small string)\", function () {\n//     return small.json();\n//   });\n// }\n\nbench(\"blob.slice()\", function () {\n  return small.slice();\n});\n\nif ((await small.text()) !== JSON.stringify(\"hello world \")) {\n  throw new Error(\"blob.text() failed\");\n}\n\nawait run();\n","sourceCodeStart":9,"sourceCodeEnd":31,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/bench/snippets/blob.mjs#L9-L31","documentation":"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).","triggerScenarios":"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.","commonSituations":"Restrictive permissions on subdirectories (root-owned dirs inside the repo), exotic glob syntax copied from another tool, huge/deep `**` trees hitting OS limits.","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"],"exampleFix":"// before (package.json)\n\"workspaces\": [\"**/*\"]\n\n// after\n\"workspaces\": [\"apps/*\", \"packages/*\"]","handlingStrategy":"validation","validationCode":"function workspacesGlobsResolve(globs) {\n  for (const pattern of globs) {\n    try {\n      const matches = [...new Bun.Glob(pattern).scanSync(\".\")];\n      if (matches.length === 0) console.warn(`pattern matches nothing: ${pattern}`);\n    } catch {\n      return false;\n    }\n  }\n  return true;\n}","typeGuard":"const isSimpleGlob = (p) => !/(\\*\\*.*\\*\\*|\\[!|\\{.*,.*\\})/.test(p);","tryCatchPattern":null,"preventionTips":["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"],"tags":["workspaces","glob","filesystem","install"],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}