Open rwsabhishek opened 1 year ago
Found same issue just now. @rwsabhishek thanks for the hint. Hopefully it'll be part of core package.
Try dynamic import when importing components that using postscribe.
import dynamic from 'next/dynamic'
const ExternalScriptComponent = dynamic(() => import('@/components/...'), {
ssr: false,
})
I am facing the below error in react/next js - window is not defined
MY SOLUTION - So to resolve this for now, I have to edit the node module postscribe.js file and add following conditions in line 1335.
![image](https://user-images.githubusercontent.com/107095684/198974059-4946dcab-528c-4852-9a51-475b48671e22.png)
Edited Code on line 1335 -
var work={}; if (typeof window !== "undefined") work = window.document.createElement('div');
It will be helpful if you add this condition at your module js file. So i will use the latest version