question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'setTheme' of undefined

See original GitHub issue

Hi, 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:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kind-sergecommented, Jun 13, 2019

Thank you for making it real 😃

0reactions
Tyriarcommented, Jun 13, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found