-
Notifications
You must be signed in to change notification settings - Fork 124
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
Error working with next.js #65
Comments
It seems that the cause is Next.js is doing Server Side Rendering and React-WordCloud can only be rendered on the client side, a quick fix would be: { process.browser && <ReactWordCloud words={props.words} options={props.wordCloudOptions} /> } If it's a viable solution, maybe you can make React-WordCloud server-side-renderable, and that would be great. |
@yifeikong Thanks for the workaround. I've faced the same problem when I was testing my components with |
@yifeikong, I'm not familiar with how to make this library compatible for server-side rendering. Its underlying dependencies need access to DOM methods. If you have a rough idea and submit a PR, happy to look over it once I get more context. Thanks! |
Not sure if this is related: vercel/next.js#9890 (comment) I'm not familiar with bundling this package, but I believe |
Closing the issue, but if anyone has more suggestions to make this work with Next/Vercel, let me know through a PR! |
Hi I have the same issue and I appylied the solution from @yifeikong it worked however the console shows the following warning :
Any idea how to fix it? |
Stack trace:
Minimal reproducible repo: https://github.com/yifeikong/wc-next-bug
The text was updated successfully, but these errors were encountered: