Skip to content
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

RAF-Manager is throwing window is not defined. #18

Open
zachjonesnoel opened this issue Sep 3, 2021 · 3 comments
Open

RAF-Manager is throwing window is not defined. #18

zachjonesnoel opened this issue Sep 3, 2021 · 3 comments

Comments

@zachjonesnoel
Copy link

After installation of particles-bg - "^2.5.5", the first time when running it worked. And now when I did npm i and tried to run the projects, raf-manager is throwing this error.
I don't see raf-manager GitHub repo, even npm doesn't have it. If in case something on raf-manager has changed or deprecated, please update particles-bg package as well.
image

@zachjonesnoel
Copy link
Author

When I reinstalled the package and it worked fine but when I tried to build the project, it threw the same error.

@joeyscarim
Copy link

joeyscarim commented Sep 9, 2021

Are you using nextjs?

If so, you can dynamically import the package on the client side only:

import dynamic from 'next/dynamic';

const ParticlesBg = dynamic(() => import('particles-bg'), {
  ssr: false,
});

@zachjonesnoel
Copy link
Author

Yea, I'm using NextJS. Let me try it out. Thanks @joeyscarim

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

2 participants