react-stockcharts icon indicating copy to clipboard operation
react-stockcharts copied to clipboard

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

Open ru4ert opened this issue 2 years ago • 5 comments

Does anyone have an idea why the fitWidth component is not working and how to fix this?

fitWidth.js:59 Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
    at ResponsiveComponent.<anonymous> (fitWidth.js:59:1)
    at callCallback (react-dom.development.js:13122:1)
    at commitUpdateQueue (react-dom.development.js:13143:1)
    at commitLayoutEffectOnFiber (react-dom.development.js:23263:1)
    at commitLayoutMountEffects_complete (react-dom.development.js:24578:1)
    at commitLayoutEffects_begin (react-dom.development.js:24564:1)
    at commitLayoutEffects (react-dom.development.js:24502:1)
    at commitRootImpl (react-dom.development.js:26779:1)
    at commitRoot (react-dom.development.js:26638:1)
    at finishConcurrentRender (react-dom.development.js:25937:1)
(anonymous) @ fitWidth.js:59
callCallback @ react-dom.development.js:13122
commitUpdateQueue @ react-dom.development.js:13143
commitLayoutEffectOnFiber @ react-dom.development.js:23263
commitLayoutMountEffects_complete @ react-dom.development.js:24578
commitLayoutEffects_begin @ react-dom.development.js:24564
commitLayoutEffects @ react-dom.development.js:24502
commitRootImpl @ react-dom.development.js:26779
commitRoot @ react-dom.development.js:26638
finishConcurrentRender @ react-dom.development.js:25937
performConcurrentWorkOnRoot @ react-dom.development.js:25765
workLoop @ scheduler.development.js:266
flushWork @ scheduler.development.js:239
performWorkUntilDeadline @ scheduler.development.js:533
react-dom.development.js:18572 The above error occurred in the <fitWidth(CandleStickChartWithCHMousePointer)> component:

    at ResponsiveComponent (http://localhost:3000/static/js/bundle.js:143641:7)
    at div
    at http://localhost:3000/static/js/bundle.js:4678:66
    at Container (http://localhost:3000/static/js/bundle.js:32132:19)
    at ChartFn (http://localhost:3000/main.79350bc3cb6201a53177.hot-update.js:58:5)
    at main
    at http://localhost:3000/static/js/bundle.js:4678:66
    at Box (http://localhost:3000/static/js/bundle.js:32997:72)
    at div
    at http://localhost:3000/static/js/bundle.js:4678:66
    at Box (http://localhost:3000/static/js/bundle.js:32997:72)
    at Live (http://localhost:3000/static/js/bundle.js:2682:76)
    at Outlet (http://localhost:3000/static/js/bundle.js:132320:26)
    at div
    at http://localhost:3000/static/js/bundle.js:4678:66
    at Box (http://localhost:3000/static/js/bundle.js:32997:72)
    at div
    at App (http://localhost:3000/static/js/bundle.js:883:5)
    at Routes (http://localhost:3000/static/js/bundle.js:132412:5)
    at Routes (http://localhost:3000/static/js/bundle.js:112:5)
    at InnerThemeProvider (http://localhost:3000/static/js/bundle.js:32210:70)
    at ThemeProvider (http://localhost:3000/static/js/bundle.js:31595:5)
    at ThemeProvider (http://localhost:3000/static/js/bundle.js:32230:5)
    at Styling (http://localhost:3000/static/js/bundle.js:307:107)
    at FinnhubProvider (http://localhost:3000/static/js/bundle.js:3525:5)
    at LocalizationProvider (http://localhost:3000/static/js/bundle.js:39756:81)
    at Provider (http://localhost:3000/static/js/bundle.js:128474:5)
    at SnackbarProvider (http://localhost:3000/static/js/bundle.js:96908:24)
    at Router (http://localhost:3000/static/js/bundle.js:132345:15)
    at BrowserRouter (http://localhost:3000/static/js/bundle.js:131154:5)

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.

ru4ert avatar Jun 13 '22 08:06 ru4ert

I am also having this issue. Have you solved it yet?

ngminhhieu avatar Oct 11 '22 17:10 ngminhhieu

@ngminhhieu nope

ru4ert avatar Oct 13 '22 19:10 ru4ert

Any updates? Also having this issue

patrickcook28 avatar Sep 02 '23 19:09 patrickcook28

I am also having this issue. Anyone able to solve it?

muneebwaqas416 avatar Jun 11 '24 10:06 muneebwaqas416

Yeah, I was facing the same error.It was happening because I was using the reactjs version 18.x with reactstockcharts.I solved this error by downgrading the reactjs version to 16.

"react": "^16.14.0", "react-dom": "^16.14.0",

muneebwaqas416 avatar Jun 11 '24 21:06 muneebwaqas416