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

ReferenceError: window is not defined - NextJs 10.1.3 - react-perf-devtool #88

Open
srittam-personal opened this issue Dec 11, 2021 · 1 comment

Comments

@srittam-personal
Copy link

Hi @nitin42 ,

I am facing an issue after installing the package to my NEXT app . I am new to NEXT and exploring this package to check on performance of the app and encountered with below error .

  1. Added the package
  2. imported the package
    const { registerObserver } = require('react-perf-devtool');
    But can see a warning in vscode itself saying :
Could not find a declaration file for module 'react-perf-devtool'. 'xxx/node_modules/react-perf-devtool/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/react-perf-devtool` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-perf-devtool';`

Also after running my dev , i got below error in my log :

window is not defined
    at Object.<anonymous> (xxx/node_modules/react-perf-devtool/lib/devtool-hook.js:1:224)

I am using

  • Next app version : 10.1.3
  • React : 17.0.1

Let me know if you need more info on this . Thanks in advance !

@srittam-personal
Copy link
Author

@nitin42 , Let me know once you get a chance to look at this .

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

1 participant