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

Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. #32

Open
rohitpotangale opened this issue Dec 26, 2018 · 5 comments

Comments

@rohitpotangale
Copy link

Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
at LoadingOverlayWrapper.componentDidMount (LoadingOverlay.js?a257:94)
at commitLifeCycles (react-dom.development.js?cada:8770)
at commitAllLifeCycles (react-dom.development.js?cada:9946)
at HTMLUnknownElement.callCallback (react-dom.development.js?cada:542)
at Object.invokeGuardedCallbackDev (react-dom.development.js?cada:581)
at invokeGuardedCallback (react-dom.development.js?cada:438)
at commitRoot (react-dom.development.js?cada:10050)
at performWorkOnRoot (react-dom.development.js?cada:11017)
at performWork (react-dom.development.js?cada:10967)
at requestWork (react-dom.development.js?cada:10878)

i am using version "react-loading-overlay": "^1.0.0"
trying to wrap my login component with





but it showing above error message not able to find out where is the exact error to fix.

@derrickpelletier
Copy link
Owner

derrickpelletier commented Dec 26, 2018

What version of react are you using? And what browser

@shakti97
Copy link

Cannot read property 'style' of null

  at Window.getComputedStyle (node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/browser/Window.js:524:20)
  at LoadingOverlayWrapper.componentDidMount (node_modules/react-loading-overlay/lib/LoadingOverlay.js:94:33)
  at commitLifeCycles (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:9411:22)
  at commitAllLifeCycles (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:10808:7)
  at HTMLUnknownElement.callCallback (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:2377:14)

i used this overlay but while testing it give this error . Can you help me, how should i resolve it

@derrickpelletier
Copy link
Owner

@shakti97 your tests are running in an environment that doesn't have a true Window instance.
You'll need to mock window.getComputedStyle until i can put a condition in place for it

@kinothUI
Copy link

kinothUI commented Jul 26, 2020

@derrickpelletier I am facing the same error using overlayFactory() from react-bootstrap-table2-overlay and react 16.13.1 either on latest firefox or chrome browser.

Screenshot 2020-07-27 at 00 55 57

Since I am using a browser I'd guess I got a true window Instance, don't i?
Can you help me on this?

@tekbahadur1996
Copy link

tekbahadur1996 commented Jun 4, 2021

@kinothUI I think this may help
https://github.com/react-bootstrap-table/react-bootstrap-table2/issues/578#issuecomment-550600284
You have to add noDataIndication

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

5 participants