No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. omnichronous
    O
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Best 0
    • Groups 0

    omnichronous

    @omnichronous

    0
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    omnichronous Follow

    Latest posts made by omnichronous

    • Custom SSR error handling in extension.js causing dev server to fail

      So I’m trying to customize the error pages in SSR mode. I have a custom route set up to show a 500 error page and I’m following the instructions from the Quasar docs and editing /src-ssr/extension.js in order to see my changes in dev mode. I’m basically testing with code copied from /src-ssr/index.js and my file looks rougly like this:

      module.exports.extendApp = function ({ app, ssr }) {
        app.get('*', (req, res) => {
          res.setHeader('Content-Type', 'text/html')
          ssr.renderToString({ req, res }, (err, html) => {
            res.redirect('/error500')
          })
        })
      }
      

      With this code, when I try to access any route on the app I get a dev server error. Anything executed in the ssr.renderToString() callback throws the error handleError is not defined in client/node_modules/@quasar/app/lib/dev-server.js.

      Alternatively, trying to execute res.redirect('/error500') in the app.get() callback leads to a redirect loop.

      So how would redirecting to a custom route work in dev mode?

      posted in Help
      O
      omnichronous