jupyterlab-monaco icon indicating copy to clipboard operation
jupyterlab-monaco copied to clipboard

Editor fails to start at the second time

Open gdlmx opened this issue 6 years ago • 1 comments

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

gdlmx avatar May 02 '18 18:05 gdlmx

Had the same problem. Created a pull request that fixes this.

spec2e avatar May 25 '18 13:05 spec2e