Upgrading from 1.2.2 to 2.0.0 on NextJS 14.2.3 App throws 'window not defined error'
OmarResponsival opened this issue · comments
I tried to update today an application that's working fine with no issues or warnings on version 1.2.2 but after upgrading to 2.0.0 with everything else exactly the same, I get a 'ReferenceError: window is not defined' from webpack at runtime.
This library only works on browser, so you need to handle checking the environment:
I've published a fix to silence the error, but the lib will still not work unless it is browser environment.
Awrsome! Thank you very much for your quick response and fix.
I am only using it on the browser in a "use client" component and the
previous version works and didn't trigger the error message.
Thanks again for your help.
…On Sun, May 12, 2024, 8:40 AM Alex Tan Hong Pin ***@***.***> wrote:
I've published a fix to silence the error, but the lib will still not work
unless it is browser environment.
—
Reply to this email directly, view it on GitHub
<#16 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFQ3RNXBM5L3CKPDYZ7CZA3ZB5PLDAVCNFSM6AAAAABHSQE2ECVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBWGIZTGNRWGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>