{"record":{"id":"39bbb757b4dd8fcc","repo":"windmill-labs/windmill","slug":"bundle-failed-n-attempt-output","errorCode":null,"errorMessage":"bundle failed:\\n${attempt.output}","messagePattern":"bundle failed:\\\\n(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"backend/windmill-api/src/apps_raw_bundler.ts","lineNumber":107,"sourceCode":"\n\tconst outDir = path.join(dir, 'dist')\n\t// Prefer the CLI the image installed: no npm reachability needed at deploy\n\t// time. It can predate `app bundle` (the images install it unpinned), and a\n\t// CLI without the command exits with cliffy's usage text before building\n\t// anything — so that specific failure, and only it, falls back to fetching\n\t// the one for this server's release. `wmill --version` isn't used to decide:\n\t// it reports npm's latest release as well as its own, and it reaches out to\n\t// npm to do so, which is the cost this branch exists to avoid.\n\tconst installed = prefer_installed_cli ? Bun.which('wmill') : null\n\tlet buildOutput: string | undefined\n\tif (installed) {\n\t\tconst attempt = spawn([installed, 'app', 'bundle', dir, '--out', outDir])\n\t\t// Colours sit between the words cliffy prints, so match on the stripped text.\n\t\tconst plain = attempt.output.replace(/\\x1b\\[[0-9;]*m/g, '')\n\t\tif (attempt.ok) {\n\t\t\tbuildOutput = attempt.output\n\t\t} else if (!/Unknown command|Usage:\\s+wmill app\\b/.test(plain)) {\n\t\t\tthrow new Error(`bundle failed:\\n${attempt.output}`)\n\t\t}\n\t}\n\tif (buildOutput === undefined) {\n\t\tbuildOutput = run([...cli_command, dir, '--out', outDir], 'bundle')\n\t}\n\n\tconst read = async (name: string) => {\n\t\ttry {\n\t\t\treturn await fs.readFile(path.join(outDir, name), 'utf8')\n\t\t} catch {\n\t\t\treturn ''\n\t\t}\n\t}\n\tconst js = await read('bundle.js')\n\tconst css = await read('bundle.css')\n\tif (js === '') {\n\t\tthrow new Error('bundle produced no javascript:\\n' + buildOutput)\n\t}","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/backend/windmill-api/src/apps_raw_bundler.ts#L89-L125","documentation":"Ruby inline-dependency jobs in Windmill are run through a patched bundler shim (windmill/inline). Requiring the stock 'bundler/inline' is blocked because it bypasses Windmill's Gemfile processing (source rewriting, credential handling), so this error is raised at resolve time.","triggerScenarios":"A ruby script's top-of-file dependency block (or the script body) contains `require 'bundler/inline'` — detected by regex before execution.","commonSituations":"Scripts copied from generic bundler documentation or Stack Overflow that use the standard bundler/inline idiom; older Windmill scripts written before the windmill/inline shim existed.","solutions":["Replace `require 'bundler/inline'` with `require 'windmill/inline'` — the Gemfile DSL is otherwise identical","Keep the `gemfile(true) do ... end` block unchanged; only the require line changes","Update internal templates/snippets that still reference bundler/inline"],"exampleFix":"// before\nrequire 'bundler/inline'\n// after\nrequire 'windmill/inline'","handlingStrategy":"validation","validationCode":"function validateRubyDeps(code) {\n  if (/^\\s*require\\s*['\"]bundler\\/inline['\"]/m.test(code)) {\n    throw new Error(\"replace require 'bundler/inline' with require 'windmill/inline'\");\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runRubyScript(code);\n} catch (e) {\n  if (/require 'bundler\\/inline'/.test(e.message)) {\n    code = code.replace(/require\\s*['\"]bundler\\/inline['\"]/g, \"require 'windmill/inline'\");\n    return runRubyScript(code);\n  }\n  throw e;\n}","preventionTips":["Always use windmill/inline in Windmill ruby scripts","Lint templates/snippets for the old require line","Keep team ruby starter templates updated"],"tags":["ruby","bundler","dependency-installation","api-migration"],"backgroundTag":"bundler-inline-deprecated","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}