Home

Issue: 3072

Loading indicator also visible in ssr

[issue link]

Hey!
Minor but crazy but here πŸ˜„
I make this conditional mode rendering:

  serverMiddleware: [{
    handler(req, res, next) {
      let isBot = crawlersRegex.test(req.headers['user-agent'])
      res.spa = !isBot
      next()
    }
  }]

Sometimes (maybe when server is slow) the loading indicator will also be visible when there is a bot user agent. In practice google crawls my page and only the loading indicator is visible.

If I always have res.spa = false the bug will not appear. It appears only then the spa can change.
Potentially some caching in the nuxt cure from the last request?

Reproduce:

Chome with GoogleBot user agent.
Open the element inspector.
Hit refresh (repeat only after a full page load, repeat until the issue appears).
Sometimes the loading indicator will be visible for few millis even if all requests are made with a GoogleBot user agent (aka spa=false).

Workaround:

loadingIndicator: false

This question is available on Nuxt.js community (#c2659)