[Vuejs]-Document is not defined in a Vue component imported to Nuxt when extract_css: false

0👍

This is due to the server-side rendering. If you need to specify that you want to import a resource only on the client-side, you need to use the process.client variable.

Try this:

if (process.client) {
  var styleElement = document.querySelector('style[' + ssrIdKe`
}

Leave a comment