{"record":{"id":"2835274b4d375172","repo":"windmill-labs/windmill","slug":"css-not-found","errorCode":null,"errorMessage":"CSS not found","messagePattern":"CSS not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"warning","filePath":"cli/src/commands/app/dev.ts","lineNumber":936,"sourceCode":"      const jsPath = path.join(process.cwd(), \"dist/bundle.js\");\n      if (fs.existsSync(jsPath)) {\n        res.writeHead(200, { \"Content-Type\": \"application/javascript\" });\n        res.end(fs.readFileSync(jsPath));\n      } else {\n        res.writeHead(404);\n        res.end(\"Bundle not found\");\n      }\n      return;\n    }\n\n    // Serve the bundled CSS\n    if (url === \"/dist/bundle.css\" || url === \"/bundle.css\") {\n      const cssPath = path.join(process.cwd(), \"dist/bundle.css\");\n      if (fs.existsSync(cssPath)) {\n        res.writeHead(200, { \"Content-Type\": \"text/css\" });\n        res.end(fs.readFileSync(cssPath));\n      } else {\n        res.writeHead(404);\n        res.end(\"CSS not found\");\n      }\n      return;\n    }\n\n    // Serve source maps\n    if (url === \"/dist/bundle.js.map\" || url === \"/bundle.js.map\") {\n      const mapPath = path.join(process.cwd(), \"dist/bundle.js.map\");\n      if (fs.existsSync(mapPath)) {\n        res.writeHead(200, { \"Content-Type\": \"application/json\" });\n        res.end(fs.readFileSync(mapPath));\n      } else {\n        res.writeHead(404);\n        res.end(\"Source map not found\");\n      }\n      return;\n    }\n","sourceCodeStart":918,"sourceCodeEnd":954,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/app/dev.ts#L918-L954","documentation":"The `wmill app dev` server also intercepts `/dist/bundle.css` (or `/bundle.css`) and serves `<cwd>/dist/bundle.css` with a text/css content type. If the file is absent it answers 404 with body 'CSS not found'. Like the JS-bundle check, this is a plain 404 generated inside the dev server whenever the compiled stylesheet is missing from dist/.","triggerScenarios":"Request for /dist/bundle.css while `fs.existsSync(process.cwd() + '/dist/bundle.css')` is false — the CSS bundle was never emitted, was deleted, or the CLI runs from a directory whose dist/ contains bundle.js but not bundle.css.","commonSituations":"Bundler configuration emits JS but CSS extraction fails or is disabled; partial/cleaned dist directory; running dev from the wrong folder; first page load racing an in-progress build; upgrading the bundler and losing the CSS output config.","solutions":["Run the bundle step so dist/bundle.css is produced (e.g. `wmill app bundle` or your project's build script), then reload.","Confirm the CLI is started from the app root so process.cwd()/dist matches the real output directory.","Check bundler logs for CSS/Sass/Tailwind compile errors that aborted stylesheet emission.","Verify the build config emits CSS as a separate bundle.css file (CSS extraction enabled) rather than inlined into JS.","Hard-reload the browser after rebuilding to bypass a cached 404 for /dist/bundle.css."],"exampleFix":"// before: missing dist/bundle.css -> 404 'CSS not found'\nls dist  # bundle.js only\n\n// after: rebuild with CSS extraction configured\nwmill app bundle\nls dist  # bundle.js + bundle.css","handlingStrategy":"validation","validationCode":"const cssPath = require('path').join(process.cwd(), 'dist/bundle.css');\nif (!require('fs').existsSync(cssPath)) {\n  console.warn(`Missing ${cssPath} - CSS bundle not built`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  const css = fs.readFileSync(path.join(process.cwd(), 'dist/bundle.css'));\n  res.writeHead(200, { 'Content-Type': 'text/css' });\n  res.end(css);\n} catch (err) {\n  if ((err as NodeJS.ErrnoException).code === 'ENOENT') {\n    res.writeHead(404);\n    res.end('CSS not found - rebuild the app bundle');\n  } else { throw err; }\n}","preventionTips":["Ensure the build config extracts CSS into dist/bundle.css (don't inline it into JS only).","Keep the watch build running so CSS is re-emitted on style changes.","Start `wmill app dev` from the app root so dist/ paths resolve correctly.","Fix CSS preprocessor/Tailwind compile errors promptly — a failed style build leaves no bundle.css."],"tags":["http-404","dev-server","css","build-artifacts"],"backgroundTag":"missing-build-artifact","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"}