Why donate
API Explorer
Upgrade Guide
Creating a New Project
The /quasar.config File
Convert q/app-webpack Project
Browser Compatibility
TypeScript Support
Directory Structure
Commands List
CSS Preprocessors
Page Routing with VueRouter
Lazy Loading - Code Splitting
Handling Assets
Boot Files
Prefetch Feature
API Proxying
Handling Vite
Handling import.meta.env
State Management with Pinia
Lint and Format Code
Testing & Auditing
Developing Mobile Apps
Ajax Requests
Opening Dev Server To Public
Quasar CLI with Vite - @quasar/app-vite v3
SSG 404 Error Page

Warning! Beta Stage

The Quasar SSG Mode is currently in the “beta” stage. Based on the community feedback, the API may change in the future, so check the release notes each time you upgrade “@quasar/app-vite”.

By default, a production SSG build renders the app’s Vue Router not-found route and writes it to dist/ssg/404.html.

For this to produce the expected page, your router should include a catch-all route:

/src/router/routes file

{
  path: '/:catchAll(.*)*',
  component: () => import('pages/ErrorNotFound.vue')
}

Configuration

/quasar.config file

export default defineConfig(() => ({
  ssg: {
    // Default: '404.html'
    error404HtmlFilename: 'not-found.html'
  }
}))

Set error404HtmlFilename: false if the host supplies its own error page or if you generate custom 404 files through getSsgPages().

The filename alone does not configure your host. Static providers such as Netlify, Cloudflare Pages, Vercel, and GitHub Pages automatically recognize a root 404.html. Other servers may need an explicit rule. For nginx:

location / {
    try_files $uri $uri/ =404;
}

error_page 404 /404.html;

Keep the HTTP response status as 404; serving the correct markup with a 200 response creates a soft 404. See Deploying SSG for more host-specific guidance.