user14986176
user14986176

Reputation: 257

How can I fix a JupyterLab "Code Editor out of Sync" error message?

I am seeing the error message in my JupyterLab.:

"Code Editor out of Sync. 
Please open your browser JavaScript console for bug report instructions" 

Jupyter Lab version 3.0.3 and Python version 3.7.7. I'm using both Chrome and Safari. I am still seeing the same issue.

enter image description here

Upvotes: 24

Views: 14957

Answers (4)

Advait Shirvaikar
Advait Shirvaikar

Reputation: 133

Did you download and open your colab file in your local jupyter lab ?

If so, an easy fix is to open your .ipynb colab file in notepad/notepad++ (or any text editor) and replace all \r\n with \n.

Upvotes: 13

T_T
T_T

Reputation: 1290

I had the same issue, but the cause was different from \r\n. There are unique id's for each cell, but there were duplicate id's in my file after editing it using VS Code. You can check if there are duplicates using an editor like vim. Cutting those cells and pasting them back in Jupyter Notebook (not JupyterLab) solved the problem. Of course, I tried it using a backup file ;)

Upvotes: 0

Doug Hudgeon
Doug Hudgeon

Reputation: 1549

I had the same problem after editing my Jupyterlab file in VS Code for Windows and then going back to Jupyterlab. The problem stems from my VS Code line ending settings. To fix the issue with the notebook I opened the notebook in the Jupyterlab Editor (1)

enter image description here

Scrolled down to confirm that line endings were \r\n (2)

enter image description here

Then Ctrl+F to find and replace all \r\n with \n (3)

enter image description here

Line endings should now be \n (4). You can now reopen the notebook.

enter image description here

Thanks @AdvaitShirvaikar for pointing me in the right direction!

Upvotes: 25

Rahul Ranjan
Rahul Ranjan

Reputation: 1058

Also, an other easy way that I found in my case was that it seems to be sufficient to create a new cell above / below the affected one, copy paste everything over and delete the old one.

Upvotes: 6

Related Questions