Static GitHub Issues

[549] middleware auth.js generate error

prev: Want understanding correct server-side cache page
next: Any way to figure out which bundles are used by which all pages

https://nuxtjs.org/guide/routing/#middleware

export default function (context) {
  context.userAgent = context.isServer ? context.req.headers['user-agent'] : navigator.userAgent
}

copy this code in you framwork run generate context.userAgent is undefined not work in nginx and github

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c472">#c472</a>)</em></sub></div>