react-loading-overlay icon indicating copy to clipboard operation
react-loading-overlay copied to clipboard

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

Open rohitpotangale opened this issue 6 years ago • 5 comments

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

<LoadingOverlay active = {this.state.isActive} spinner text= 'Login...' > <div className="app flex-row align-items-center" style={loginBackgroud}> </LoadingOverlay> but it showing above error message not able to find out where is the exact error to fix.

rohitpotangale avatar Dec 26 '18 09:12 rohitpotangale

What version of react are you using? And what browser

derrickpelletier avatar Dec 26 '18 20:12 derrickpelletier

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

shakti97 avatar Apr 12 '19 10:04 shakti97

@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

derrickpelletier avatar Apr 12 '19 17:04 derrickpelletier

@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?

kinothUI avatar Jul 26 '20 22:07 kinothUI

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

tekbahadur1996 avatar Jun 04 '21 06:06 tekbahadur1996