Closed shpsyte closed 3 years ago
Hi,
this should not definitely happen when SSR is not used. What is your setup please?
I had the same issue, fixed it with adding !!window.smartlook
before init.
import smartlookClient from 'smartlook-client';
// ...
useEffect(() => {
if (smartAppId && !!window.smartlook) {
smartlookClient.init(smartAppId);
}
}, []);
I'm trying to use this package, but I getting an error:
Window is not defined.
Our app is NOT server-side rendering and we're using webpack.
(node:71176) UnhandledPromiseRejectionWarning: ReferenceError: window is not defined
I tried to follow the initial steps. What should I do to work in a kind this environment?
Cheers