wufe / react-particles-js

Particles.js for React
https://rpj.bembi.dev/
MIT License
1.15k stars 106 forks source link

Uncaught TypeError: Cannot read property 'loadCanvas' of undefined #132

Closed lstrive-yn closed 4 years ago

lstrive-yn commented 4 years ago

when the router changeing in nextjs project, this error occured

The configation of {ssr: false} has been used

what can i do, thanks

matteobruni commented 4 years ago

Which version are you using? Can you share some code?

lstrive-yn commented 4 years ago

Which version are you using? Can you share some code?

I just use dynamic to dynamic import the custom Particles Component like so const Particles = dynamic(() => import('react-particles-js'), { ssr: false }); the version of nextjs is the latest(9.0.0) and the version of react-particles-js is v3.2.1

thanks again

matteobruni commented 4 years ago

I tried replicate the issue hehe: https://codesandbox.io/s/pensive-cache-n7891?file=/pages/index.js

But I got no errors, everything work fine as expected

lstrive-yn commented 4 years ago

I tried replicate the issue hehe: https://codesandbox.io/s/pensive-cache-n7891?file=/pages/index.js

But I got no errors, everything work fine as expected

I really don't know what happened, I did nothing but it works fine now😢 haha~

Thank you for your patience~