{"record":{"id":"1526cf642f4505cb","repo":"anomalyco/sst","slug":"ssr-server-bundle-index-mjs-not-found-in-the-bui","errorCode":null,"errorMessage":"SSR server bundle \"index.mjs\" not found in the build output at:\n  \"${path.resolve(outputPath, \".output\", \"server\")}\".\n\nIf your SolidStart project is entirely pre-rendered, use the `sst.cloudflare.StaticSite` component instead of `sst.cloudflare.SolidStart`.","messagePattern":"SSR server bundle \"index\\.mjs\" not found in the build output at:\n  \"(.+?)\"\\.\n\nIf your SolidStart project is entirely pre-rendered, use the `sst\\.cloudflare\\.StaticSite` component instead of `sst\\.cloudflare\\.SolidStart`\\.","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/cloudflare/experimental/solid-start.ts","lineNumber":245,"sourceCode":"        await fs.readFile(\n          path.join(outputPath, \".output\", \"nitro.json\"),\n          \"utf-8\",\n        ),\n      );\n\n      if (![\"cloudflare-module\"].includes(nitro.preset)) {\n        throw new VisibleError(\n          `SolidStart's nitro.config.ts must be configured to use the \"cloudflare-module\" preset. It is currently set to \"${nitro.preset}\".`,\n        );\n      }\n\n      // Make sure the server bundle is in the dist directory\n      if (\n        !(await existsAsync(\n          path.join(outputPath, \".output\", \"server\", \"index.mjs\"),\n        ))\n      ) {\n        throw new VisibleError(\n          `SSR server bundle \"index.mjs\" not found in the build output at:\\n` +\n            `  \"${path.resolve(outputPath, \".output\", \"server\")}\".\\n\\n` +\n            `If your SolidStart project is entirely pre-rendered, use the \\`sst.cloudflare.StaticSite\\` component instead of \\`sst.cloudflare.SolidStart\\`.`,\n        );\n      }\n\n      // Ensure `.assetsignore` file exists and contains `server`\n      const ignorePath = path.join(outputPath, \".output\", \".assetsignore\");\n      const ignorePatterns = (await existsAsync(ignorePath))\n        ? (await fs.readFile(ignorePath, \"utf-8\")).split(\"\\n\")\n        : [];\n      let dirty = false;\n      [\"server\"].forEach((pattern) => {\n        if (ignorePatterns.includes(pattern)) return;\n        ignorePatterns.push(pattern);\n        dirty = true;\n      });\n","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/cloudflare/experimental/solid-start.ts#L227-L263","documentation":"After a successful build with the correct preset, SST looks for the Nitro server bundle at `.output/server/index.mjs` and it is not there. This is the file SST wraps into the Cloudflare Worker for SSR.","triggerScenarios":"buildPlan's existsAsync check on `<outputPath>/.output/server/index.mjs` fails — build produced only static output (fully pre-rendered routes), or the Nitro output layout changed / was customized, or the build wrote to a different directory.","commonSituations":"SolidStart app where every route is pre-rendered so no server bundle is emitted; customized Nitro `output` config; interrupted or partial build; SSR disabled in SolidStart config.","solutions":["If the app is entirely pre-rendered, switch to `sst.cloudflare.StaticSite` instead of `sst.cloudflare.SolidStart`.","Ensure at least one route uses SSR/on-demand rendering so Nitro emits `server/index.mjs`.","Clean the `.output` directory and rebuild with the `cloudflare-module` preset.","Verify `outputPath` in the component config points at the directory containing `.output`."],"exampleFix":"// before (sst.config.ts)\nconst site = new sst.cloudflare.SolidStart(ctx, \"Site\", {});\n// after (fully static site)\nconst site = new sst.cloudflare.StaticSite(ctx, \"Site\", { path: \"my-solid-app\" });","handlingStrategy":"validation","validationCode":"import { existsSync } from \"fs\";\nif (!existsSync(\".output/server/index.mjs\")) console.warn(\"No SSR bundle — use StaticSite or enable SSR routes\");","typeGuard":"const hasServerBundle = (out: string) => existsSync(`${out}/server/index.mjs`);","tryCatchPattern":"try {\n  new sst.cloudflare.SolidStart(app, \"Site\", {});\n} catch (e) {\n  if (String(e).includes(\"index.mjs\")) console.error(\"Switch to StaticSite or enable SSR\");\n  else throw e;\n}","preventionTips":["Verify `.output/server/index.mjs` exists before deploy.","Use StaticSite for fully pre-rendered SolidStart apps.","Keep the `cloudflare-module` preset so Nitro emits the mjs bundle."],"tags":["solidstart","nitro","cloudflare","ssr","missing-bundle"],"backgroundTag":"ssr-build-output-not-found","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}