I installed nuxtjs/device and in localhost it works well and I get what I wanted with ctx.isMobile. But I use nuxt generate and when I deploy my app. it doesnt work. So for this module to work must there be a server? or is there a way to detect device in static generate mode?.
I added this on my modules like this
modules: [
'@nuxtjs/device',
]
and I use it in my components like this
this.$device.isMobile
and like this
ctx.isMobile
Look at this part of @nuxtjs/device's documentation
https://github.com/nuxt-community/device-module#options
defaultUserAgentoption can be used fornpm run generate.It says to use
defaultUserAgentoption to make it work with nuxt generate mode.