-
Notifications
You must be signed in to change notification settings - Fork 457
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
When render this component from server, it will report an error window is not define #40
Comments
Hi @xalc! I think it's because of the Redux devtools, it's the only place it's using the |
Closing due to merged solution. If the problem continues, feel free to reopen |
Hi @mcallegari10 I'm running in to the same problem even after release
I tried to take a look at the index.js but its a bit jumbled up for me. I tried downgrading to the last release and implemented the changes that you thought should have fixed the issue (regarding the Redux tools) but still no luck. |
same issue here, trying to use it within nextjs :/ |
The issue still persists.. |
same issue here with nextjs |
One solution I found is to import it dynamically in next.js with ssr set to false:
|
how to import dynamically addResponseMessage in next js |
@pdeivaraj I was able to import addResponseMessage with the following:
|
|
how to import dynamically isWidgetOpened in next js |
@jordigoyanes This is not working with React >17 and Next > 12. Any one has got it to work? |
import dynamic from "next/dynamic"; this fixed my problem you can view for more details here |
The error detail is here:
/Path/To/Project/node_modules/react-chat-widget/lib/index.js:555
return window && document && document.all && !window.atob;
^
ReferenceError: window is not defined
at /Path/To/Project/node_modules/react-chat-widget/lib/index.js:555:9
at /Path/To/Project/node_modules/react-chat-widget/lib/index.js:544:46
at module.exports (/Path/To/Project/node_modules/react-chat-widget/lib/index.js:589:46)
at Object. (/Path/To/Project/node_modules/react-chat-widget/lib/index.js:13376:36)
at webpack_require (/Path/To/Project/node_modules/react-chat-widget/lib/index.js:30:30)
at Object. (/Path/To/Project/node_modules/react-chat-widget/lib/index.js:13322:1)
at webpack_require (/Path/To/Project/node_modules/react-chat-widget/lib/index.js:30:30)
at Object.defineProperty.value (/Path/To/Project/node_modules/react-chat-widget/lib/index.js:13249:15)
at webpack_require (/Path/To/Project/node_modules/react-chat-widget/lib/index.js:30:30)
at Object.defineProperty.value (/Path/To/Project/node_modules/react-chat-widget/lib/index.js:13177:21)
at webpack_require (/Path/To/Project/node_modules/react-chat-widget/lib/index.js:30:30)
at Object.defineProperty.value (/Path/To/Project/node_modules/react-chat-widget/lib/index.js:13079:15)
at webpack_require (/Path/To/Project/node_modules/react-chat-widget/lib/index.js:30:30)
at Object. (/Path/To/Project/node_modules/react-chat-widget/lib/index.js:9460:15)
at webpack_require (/Path/To/Project/node_modules/react-chat-widget/lib/index.js:30:30)
at Object.defineProperty.value (/Path/To/Project/node_modules/react-chat-widget/lib/index.js:9423:12)
do you have any idea to fix this or some workflow?
The text was updated successfully, but these errors were encountered: