{"record":{"id":"45d9464cacb82499","repo":"quasarframework/quasar","slug":"render-failed","errorCode":null,"errorMessage":"Render failed","messagePattern":"Render failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app-vite/lib/modes/ssg/ssg-devserver.js","lineNumber":294,"sourceCode":"                res.writeHead(404)\n                res.end('404 | Page Not Found')\n                return\n              }\n\n              if (err?.redirectUrl) {\n                /**\n                 * We were told to redirect to another URL,\n                 * but we're in SSG mode, so we cannot!\n                 */\n                res.writeHead(500)\n                res.end(\n                  '500 | Internal Server Error due to redirect in SSG mode'\n                )\n                return\n              }\n\n              log()\n              warn(req.url, 'Render failed')\n\n              const { errorHeaders, errorHtml } = renderSSRError({\n                err:\n                  err instanceof Error\n                    ? err\n                    : new Error(String(err) || 'Unknown error'),\n                req,\n                rootFolder\n              })\n\n              res.writeHead(500, errorHeaders)\n              res.end(errorHtml)\n            }\n          })\n        }\n      }\n    })\n","sourceCodeStart":276,"sourceCodeEnd":312,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/app-vite/lib/modes/ssg/ssg-devserver.js#L276-L312","documentation":"Warning logged by the SSG dev server (configureServer) when an SSR render of a request fails during `quasar dev -m ssg`. It prints the failing req.url as 'Render failed', then builds an error page via renderSSRError (500 | Internal Server Error due to redirect in SSG mode for redirect-type errors) and serves it to the browser. This affects the dev server only, not production builds.","triggerScenarios":"During SSG dev mode, the SSR render middleware throws for a request — including render errors caused by redirects (which are disallowed in SSG mode, hence the '500 | Internal Server Error due to redirect in SSG mode' response path) or any other SSR exception; the catch handler logs the URL with the 'Render failed' tag.","commonSituations":"Calling router.push or returning a redirect from a route guard during SSR in SSG mode; a component throwing during server render; accessing browser-only APIs on the server in a dev page.","solutions":["If the cause is a redirect: remove the server-side redirect (route guard navigation) or guard it with process.env.CLIENT, since redirects are not supported in SSG mode.","Inspect the accompanying error (err is passed to renderSSRError and rendered) to find the throwing code path.","Fix SSR-unsafe APIs in the page for the failing URL.","Reproduce the exact URL locally and test after fixing; dev server will hot-reload."],"exampleFix":"// before\nif (!auth.user) { return next('/login') }\n// after\nif (process.env.CLIENT && !auth.user) { return next('/login') }","handlingStrategy":"try-catch","validationCode":"// Guard redirects so they only run on the client (SSG dev forbids SSR redirects)\nrouter.beforeEach((to) => {\n  if (process.env.CLIENT && !auth.user && to.path !== '/login') return '/login'\n})","typeGuard":"function isClient(): boolean {\n  return typeof window !== 'undefined'\n}","tryCatchPattern":"try {\n  const html = await renderApp(req.url)\n} catch (err) {\n  console.error(`Render failed for ${req.url}:`, err)\n  // in SSG dev mode this becomes a 500 page; fix the redirect or SSR-unsafe code\n}","preventionTips":["Never perform server-side redirects (guards returning a location) in SSG mode; gate them with process.env.CLIENT.","Guard browser-only APIs in code executed during SSR.","Reproduce failing dev URLs locally after each route-guard change.","Read the rendered error page — it carries the underlying err via renderSSRError."],"tags":["ssg","ssr","dev-server","render-error","redirect"],"backgroundTag":"ssg-render-failed","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}