Static GitHub Issues

[499] Disable server side rendering in layouts / pages / configuration

prev: Vue router and vue2-vreadcrumbs
next: Django + Nuxt.js

Putting this in so it's not lost and / or for anyone has any further thoughts. After an earlier discussion with @Atinux on Gitter.

The change

Allow us to turn off server side rendering for selected areas of our applications, configured in a similar way to middleware, via nuxt.config.js, layout or pages.

Why?

For us, it's related to JWT token authentication. At present it's not possible to re-hydrate our Vuex User and related stores after the users refreshes, until after the application has rendered (forcing the user through middlewares that cannot see they're authenticated and kicking them out). If we attempt to force the store population on the client side before the application is rendered, the HTML between the server and client is different and we understandably receive:

Vue warn: The client-side rendered virtual DOM tree is not matching server-rendered content.

This means it's not currently possible to support JWT easily in Nuxt. I'm pretty certain there'll be other legitimate use cases for forcing SSR: false on selected areas of an application.

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