How to fix Nuxt error with SSR (Cannot read property 'getElementsByClassName' of null)
MatteoGauthier opened this issue · comments
Mattèo Gauthier commented
I searched for an answer but i can't find anything.
Here is my file
nuxt.config.js
plugins: [
{
src: "~/plugins/vue-particles",
ssr: false
}
]
it throws the error Cannot read property 'getElementsByClassName' of null
on route change.
Mattèo Gauthier commented
I fixed this by adding the mode
to client
plugins: [
{
src: "~/plugins/vue-particles",
mode: 'client'
}
]
Problem solved, weird issue