{"record":{"id":"aea5dde18ab56b15","repo":"windmill-labs/windmill","slug":"source-map-not-found","errorCode":null,"errorMessage":"Source map not found","messagePattern":"Source map not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"info","filePath":"cli/src/commands/app/dev.ts","lineNumber":949,"sourceCode":"      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\n    if (url === \"/dist/bundle.css.map\" || url === \"/bundle.css.map\") {\n      const mapPath = path.join(process.cwd(), \"dist/bundle.css.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\n    // Serve injected HTML for root and any other path","sourceCodeStart":931,"sourceCodeEnd":967,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/app/dev.ts#L931-L967","documentation":"Requests for the JS source map `/dist/bundle.js.map` (or `/bundle.js.map`) are served from `<cwd>/dist/bundle.js.map` with application/json content type; if the map file is missing the dev server replies 404 'Source map not found'. Source maps are optional debug artifacts, so this error only affects debugging (stack traces pointing at original sources), not app functionality.","triggerScenarios":"Browser devtools request /dist/bundle.js.map (because bundle.js references it via //# sourceMappingURL, or devtools 'enable source maps' is on) while `fs.existsSync(process.cwd() + '/dist/bundle.js.map')` is false — bundler built without sourcemaps or cleaned them.","commonSituations":"Production-style build with sourcemaps disabled (`sourcemap: false` / --no-sourcemap) served through dev; dist cleaned of .map files to save space; bundler version change altering sourcemap output; loading dev server from the wrong cwd.","solutions":["Rebuild with source maps enabled so dist/bundle.js.map is emitted (e.g. set `sourcemap: true` in the bundler config or drop --no-sourcemap).","If maps are intentionally disabled, ignore the 404 or remove/condition the sourceMappingURL comment in the generated bundle.","Confirm the CLI runs from the app root so the map is looked up in the correct dist/.","Stop stripping .map files from dist/ in clean/deploy scripts if you need devtools debugging.","Hard-reload the browser after regenerating maps so devtools refetches /dist/bundle.js.map."],"exampleFix":"// before: bundler config without maps\nexport default { sourcemap: false };\n\n// after\nexport default { sourcemap: true }; // emits dist/bundle.js.map","handlingStrategy":"validation","validationCode":"const mapPath = require('path').join(process.cwd(), 'dist/bundle.js.map');\nif (!require('fs').existsSync(mapPath)) {\n  console.warn('No JS source map; devtools will show bundled code only');\n}","typeGuard":null,"tryCatchPattern":"try {\n  const map = fs.readFileSync(path.join(process.cwd(), 'dist/bundle.js.map'));\n  res.writeHead(200, { 'Content-Type': 'application/json' });\n  res.end(map);\n} catch (err) {\n  if ((err as NodeJS.ErrnoException).code === 'ENOENT') {\n    res.writeHead(404);\n    res.end('Source map not found');\n  } else { throw err; }\n}","preventionTips":["Enable sourcemaps in the bundler config so bundle.js.map is always emitted during development.","Don't strip *.map files from dist/ in clean scripts used by the dev workflow.","Treat this 404 as non-blocking: it only affects devtools source viewing.","Hard-reload after rebuilds so devtools refetches the map instead of caching the 404."],"tags":["http-404","source-maps","dev-server","typescript"],"backgroundTag":"source-map-not-found","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"}