jupyterlab-monaco
jupyterlab-monaco copied to clipboard
Editor fails to start at the second time
There is a weird behavior observed in my setup: After a file is open and then closed with Monaco, when it is open the second time, the following error message pops up in the Firefox JS console:
TypeError: this.editor is undefined [Learn More] index.js:72
which is corresponded to the following line: https://github.com/jupyterlab/jupyterlab-monaco/blob/f710e41b0edee042bbd4be99f28690e495104c0c/src/index.ts#L95
This error prevents the editor to show up in the Jupyterlab window. It seems that the old MonacoWidget
object is not destroyed when the editor tab is closed. Refreshing the webpage solved this problem.
My environment:
- jupyterlab-monaco commit f710e41
- Firefox 59.0.2
- Jupyterlab 0.32.1
Had the same problem. Created a pull request that fixes this.