-
Notifications
You must be signed in to change notification settings - Fork 574
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
ReferenceError: window is not defined
while trying to vote with snapshot.js
#992
Comments
Thanks for opening the issue. Let me know if I can help |
Hey all, i am experiencing the same issue while i was trying to quickly prototype something in node. Anyhow, after getting this out of the way, i realized the this error is coming from this line here
The generated node code looks like this :
and i think it throws the error because its trying to access window object without first checking if the window object exists, which ofc doesnt in a node env.
which worked. So i figured i am on the right track. I opened a small pr which will hopefully fix this here : #998 |
* added a check for window to avoid breaking node envs addresses #992 * v0.11.22 --------- Co-authored-by: Chaitanya <yourchaitu@gmail.com>
Thank you @fffbbbccc it is fixed now |
Expected behavior
Should work without error
Steps to reproduce the behavior
npm install @snapshot-labs/snapshot.js
in any nodejs projectThe text was updated successfully, but these errors were encountered: