Skip to content

How to fix Nuxt error with SSR (Cannot read property 'getElementsByClassName' of null) #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MatteoGauthier opened this issue May 6, 2020 · 1 comment

Comments

@MatteoGauthier
Copy link

MatteoGauthier commented May 6, 2020

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.

@MatteoGauthier
Copy link
Author

MatteoGauthier commented May 6, 2020

I fixed this by adding the mode to client

plugins: [
    {
      src: "~/plugins/vue-particles",
      mode: 'client'
    }
  ]

Problem solved, weird issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant