quasarframework/quasar · error

Failed to render ${errorsEncountered} SSG page${errorsEncoun

Error message

Failed to render ${errorsEncountered} SSG page${errorsEncountered > 1 ? 's' : ''}.

What it means

At the end of #renderSsgPages, if any SSG pages failed to render, the build emits a FAIL line with the count and this prominent warning summarizing how many pages could not be rendered. Details for each page were already printed earlier by the renderer error handler.

Source

Thrown at app-vite/lib/modes/ssg/ssg-builder.js:706

          threadsNumber: ssgRendererConcurrency
        }
      )
    } else {
      for (const ssgPage of ssgPageList) {
        await renderPage(ssgPage)
      }
    }

    if (errorsEncountered) {
      if (!['warn', 'ignore'].includes(onSsgRendererError)) {
        fatal(
          `Failed to render ${errorsEncountered} SSG page${errorsEncountered > 1 ? 's' : ''}. Check details above.`,
          'FAIL'
        )
      }

      console.log()
      warn(
        `Failed to render ${errorsEncountered} SSG page${errorsEncountered > 1 ? 's' : ''}.`,
        'WARNING!'
      )
      console.log()
    }

    await this.removeFile('__ssg__')

    if (errorsEncountered) {
      const renderedCount = ssgPageList.length - errorsEncountered
      done({
        target:
          ` ${renderedCount}/${ssgPageList.length} SSG page` +
          `${renderedCount > 1 ? 's' : ''}${concurrencyBanner}`
      })
    } else {
      done()
    }

View on GitHub (pinned to 4841521b5f)

Solutions

  1. Scroll up to the per-page 'Render error' output to see each failing page and its stack
  2. Fix the shared root cause (usually browser-only code or a failing fetch) in the listed pages
  3. Set build.ssg.exclude for routes that genuinely cannot be pre-rendered
  4. Re-run the SSG build and confirm the failed-page count drops to zero

Example fix

// before (quasar.config.js)
ssg: { exclude: [] }
// after
ssg: { exclude: ['/problematic-route'] }
Defensive patterns

Strategy: fallback

Try / catch

// treat SSG build result as partial
const failedPages = collectRenderErrors()
if (failedPages.length > 0) {
  console.error(`Fix or exclude: ${failedPages.join(', ')}`)
  process.exitCode = 1 // fail CI so partial output isn't shipped
}

Prevention

When it happens

Trigger: One or more routes threw during the SSG pre-render phase (nonzero errorsEncountered), e.g. due to SSR-incompatible code or failing async data on specific routes.

Common situations: Migrating an SPA to SSG where several pages touch window/localStorage at module scope; a batch of dynamic routes failing due to a shared data-fetching bug; prerender timeout on heavy pages.

Related errors


AI-assisted analysis of quasarframework/quasar@4841521b5f (2026-08-30). Data as JSON: /api/errors/82079b5ada3c3cfb. Report an issue: GitHub.