Skip to content
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

This doesn't work on next.js #16

Open
techandmedia opened this issue Aug 21, 2019 · 6 comments
Open

This doesn't work on next.js #16

techandmedia opened this issue Aug 21, 2019 · 6 comments

Comments

@techandmedia
Copy link

Using the latest version of React, React-DOM and nextjs
"react": "^16.9.0",
"react-dom": "^16.9.0",
"next": "^9.0.3",

Throwing an error: "ReferenceError: window is not defined"

Nextjs already provide a guideline of how to make it works:
https://github.com/zeit/next.js/wiki/FAQ

Not sure how to make it work though,

@ayushkhanduri
Copy link

yup , i also encountered that issue , the no-ssr plugin is not working , well the main reason is that it uses intersection-observer and the first thing that intersection observer does is that it checks if it's instance has been created and attached to the global object . It happens before the componentdidmount cycle for the component. Just importing that file causes the application to crash . I don't think that even the workarounds are worth it.

@thanglong134
Copy link

Is there any way to solve this problem?

@bconnorwhite
Copy link

SSR should be fixed with #28.

@tamert
Copy link

tamert commented Feb 10, 2020

ReferenceError: window is not defined

@sagarj521
Copy link

sagarj521 commented Oct 29, 2022

this is still not working with nexjs is there any workaround for it?

@ManojShivaramAithal
Copy link

ReferenceError: window is not defined : Any Solution for this ?, Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants