Cannot read property 'setTheme' of undefined
See original GitHub issueHi, we’ve had such code:
this.terminal.setOption('theme', ....);
this.terminal.open(....);
However, with the latest changes, the internal _colorManager
gets initialized on .open()
, thus the first line fails with:
TypeError: Cannot read property 'setTheme' of undefined
at e._setTheme (Terminal.js.pre-build-optimizer.js:587)
at e.setOption (Terminal.js.pre-build-optimizer.js:307)
at t.setOption (Terminal.js.pre-build-optimizer.js:193)
It’s an easy fix on our side (just swap two lines), however, it makes sense to decouple visual customization from connectivity responsibilities. Was it an unintentional change?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Cannot read property 'setTheme' of undefined #76347 - GitHub
Not sure if this can be reproduced (happened only 2 times). I switched theme from light to dark but terminal remained light and...
Read more >html - ERROR TypeError: Cannot read properties of undefined ...
In projectService I get the error in function getLayoutTheme. The entire project.service.ts file can be seen here. getLayoutTheme() { return ...
Read more >Cannot read property 'folder' of undefined - WordPress.org
When I try to change different slideshow and save, I got this warning. Cannot read property 'folder' of undefined. And the selected slideshow...
Read more >error in console TypeError: Cannot read property 'call' of ...
TypeError : Cannot read property 'call' of undefined - the code is. the file linked to the message is a theme bundle file...
Read more >Detecting Theme Change - WebViewer - PDFTron Community
... then I get this error: ERROR TypeError: Cannot read property 'addEventListener' of undefined. I think it doesn't find the iframeWindow.
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 FreeTop 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
Top GitHub Comments
Thank you for making it real 😃
We should be able to entirely avoid these issues when this part is moved to TS strict mode, can’t wait but it’s a bit of a beast of a project https://github.com/xtermjs/xterm.js/issues/1507