Code Editor Out of Sync after using Sublime Text

Checked the Javascript console and this is what I got:
DevTools failed to load source map: Could not load content for chrome-extension://lmbegcmkonokdjbhbamhpmkihpachdbk/content.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME

Can someone help me please? I tried reinstalling and it did not work.

Thank you!

What version of JupyterLab do you use?

Some editors appear to add arbitrary line endings, contrary to the notebook specification, which led to the “Code Editor Out of Sync” messages in the past, but a patch to workaround this by harmonizing the line endings was implemented recently and released in the latest JupyterLab version.

Also, can you explain exactly, step by step, what you did? How did you use Sublime Text?

I have the latest version installed

Could you please check exactly which version you have in Help → About JupyterLab? Sometimes the installed version is not the version which is running, and it helps for posterity to have the exact number on record :slight_smile:

I was writing a .py file in JupyterLab because I wanted to run it on streamlit alongside. Then, after I confirmed that the codes worked, I used sublime text to add annotations using the # sign. Afterwards, I reopened the file in Jupyterlab to run it again and thats when i received this error.

Oh I see, im using Version 3.0.14

Thanks!

This is not the latest version :wink: The latest is 3.1.18 and the patch is in since 3.1.14, but I would recommend at least 3.1.16.

If that does not work, there will be another release soon with another fix (for \r variant).

Omg hahahaha I thought it was because I just reinstalled it! Thanks for notifying :slight_smile:

1 Like

Sorry, I managed to install 3.1.18 successfully, but it still gives me the same error.

1 Like

Thank you for checking the latest version! Would you be able to share a minimal (redacted if needed) notebook which causes this error?

Sure! How do I send it to you?

You could create a GitHub gist by dragging the notebook into the editor (https://gist.github.com/) and share the URL.

I opened the file from that gist just fine in the latest JupyterLab 3.1.18. However, the gist might have cleaned up the line endings somehow, so that the gist file doesn’t exhibit the same problem as the original.

Does the Javascript console give any other errors that mention the code being out of sync, or having lots of JSON text? That is what would really help in seeing what is wrong. What we’re looking for is the line endings, between different lines in the file, i.e., \n, \r, or \r\n.

1 Like

Are you using windows?

nope only errors like this but with different chrome extension urls and the codes in the screenshot

nope, im using a mac

1 Like

So it’s the line endings. Your other editor (Sublime Text) must be configured to use \r (you can see it on your screenshot in import all required packages: \rimport). @jasongrout developed a workaround for that (not yet released), but I don’t remember if it was for notebooks only, or for the file editor as well.

In the meantime you could configure Sublime to use \n instead. Maybe Is there any way to convert file's line ending on saving? - Technical Support - Sublime Forum or sublimetext3 - How do configure sublime to always convert to unix line endings on save? - Stack Overflow could help with that.

2 Likes