{"record":{"id":"005b6ec794a26424","repo":"windmill-labs/windmill","slug":"expected-a-js-bundle-in-esbuild-output-but-none-fo","errorCode":null,"errorMessage":"Expected a JS bundle in esbuild output but none found","messagePattern":"Expected a JS bundle in esbuild output but none found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/app/bundle.ts","lineNumber":456,"sourceCode":"  try {\n    const result = await esbuild.build(buildOptions);\n\n    if (result.errors.length > 0) {\n      log.error(colors.red(\"❌ Build failed:\"));\n      result.errors.forEach((error: any) => {\n        log.error(colors.red(error.text));\n      });\n      throw new Error(\"Build failed with errors\");\n    }\n\n    log.info(colors.green(\"✅ Bundle created successfully\"));\n\n    const outputFiles = result.outputFiles ?? [];\n    const jsFile = outputFiles.find((f) => f.path.endsWith(\".js\"));\n    const cssFile = outputFiles.find((f) => f.path.endsWith(\".css\"));\n\n    if (!jsFile) {\n      throw new Error(\"Expected a JS bundle in esbuild output but none found\");\n    }\n\n    try {\n      fs.rmSync(distDir, { recursive: true });\n    } catch {\n      //ignore\n    }\n    return { js: jsFile.text, css: cssFile?.text ?? \"\" };\n\n  } finally {\n    // Stop the native esbuild service so the process can exit (no-op for wasm).\n    await stopEsbuild();\n  }\n}\n\n/**\n * Gets the esbuild build options for use in watch mode (dev server)\n * @param entryPoint Entry point file","sourceCodeStart":438,"sourceCodeEnd":474,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/app/bundle.ts#L438-L474","documentation":"Sanity check on esbuild output in createBundle: the build succeeded (no errors), but among result.outputFiles (write:false mode) no file path ends in .js — so there is no JavaScript payload to ship. This is an esbuild configuration/output-shape anomaly, not a user code error: normally at least the entry's JS chunk is emitted. A misconfigured outfile/entry or an unexpected esbuild-wasm fallback path is the likely input at fault.","triggerScenarios":"Thrown at cli/src/commands/app/bundle.ts:456 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the bundle to rule out a transient esbuild-wasm/native mismatch (the loader falls back transparently on version mismatch)","Check that the entry point is a real script module (not CSS-only) and no custom out-extension/outfile settings strip the .js suffix","Report with the esbuild version if persistent — the result.outputFiles array having no .js entry is an internal contract break"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}