react-loading-overlay
react-loading-overlay copied to clipboard
Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
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.
What version of react are you using? And what browser
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 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 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.
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 I think this may help https://github.com/react-bootstrap-table/react-bootstrap-table2/issues/578#issuecomment-550600284 You have to add noDataIndication