[Bug] Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
See original GitHub issueHello everyone! I am using the library and it is perfect. Everything was working fine until I started seeing these errors in console:
simplebar.min.js:formatted:1911 Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
at MutationObserver.e.recalculate (simplebar.min.js:formatted:1911)
at d (simplebar.min.js:formatted:1512)
at p (simplebar.min.js:formatted:1517)
at MutationObserver.m (simplebar.min.js:formatted:1545)
When expanded it can be seen that it happens from calling the jquery .append() to scroll container. Basically what I have on the page is a container with a bunch of inputs. When the user types the input expands to fit the text until 140px by using hidden span element. I guess that means that every time the user enters a character the scrollbar is trying to recalculate and this problem occurs.
Hoping to solve the problem. Thank you.
Update
I looked through debugger and it seems that the problem occurs because the mutation observer’s property .el is undefined.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
JS: Failed to execute 'getComputedStyle' on 'Window ...
The error message says that getComputedStyle requires the parameter to be Element type. You receive it because the parameter has an incorrect type....
Read more >Failed to execute 'getComputedStyle' on 'Window' - OutSystems
On my mobile app i am getting an Error on every page which says "Failed to execute 'getComputedStyle' on 'Window': parameter 1 is...
Read more >parameter 1 is not of type 'Element'. HELP : r/learnjavascript
Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. HELP : r/learnjavascript.
Read more >T280305 Failed to execute 'getComputedStyle' on 'Window'
Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. Closed, InvalidPublicPRODUCTION ERROR.
Read more >Uncaught TypeError: Failed to execute ... - GreenSock
Uncaught TypeError : Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. By aj_m, January 28, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Solved by specifying version in cdn url. (if you use cdn to load the module)
I think they accidentally point the lastest version to beta release.
Released a fix in the latest beta releases.