# Jupyter / IJulia: Cell containing code suddenly turned blank

**URL:** <https://discourse.julialang.org/t/jupyter-ijulia-cell-containing-code-suddenly-turned-blank/53354>\
**Category:** Tooling\
**Tags:** jupyter, ijulia\
**Created:** [January 14, 2021, 8:04pm UTC](https://discourse.julialang.org/t/jupyter-ijulia-cell-containing-code-suddenly-turned-blank/53354 "2021-01-14T20:04:46Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Barmann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/michael_barmann/32/20389_2.png) [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Post date:** [January 14, 2021, 8:04pm UTC](https://discourse.julialang.org/t/jupyter-ijulia-cell-containing-code-suddenly-turned-blank/53354/1 "2021-01-14T20:04:46Z")

</div>

I’m working in a Jupyter Notebook and while in the midst of typing code, the cell I was typing in suddenly turned blank. When I try clicking on the blank cell, nothing happens. I can run the cell by clicking the little black arrow in the top left corner and a syntax error shows up below the cell, suggesting that the code is still in there but just isn’t visible.

I have no idea what I did or how to get my code back. I think maybe I hit some keyboard shortcut by mistake? Does anyone know what this means, or how to get my code back? Here’s a screenshot:

 ![Blank_cell](https://global.discourse-cdn.com/julialang/original/3X/3/d/3dc6f1733ff8836762e19f8a50dc5a28e0907f33.png)

---

<div class="post-metadata">

**Author:** ![xyz1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xyz1/32/19984_2.png) [@xyz1](https://discourse.julialang.org/u/xyz1)\
**Post date:** [January 14, 2021, 8:29pm UTC](https://discourse.julialang.org/t/jupyter-ijulia-cell-containing-code-suddenly-turned-blank/53354/2 "2021-01-14T20:29:45Z")

</div>

I don’t know about what caused it but maybe copying from the cell “blindly” to extract your code should work? Or afterall, a notebook is a JSON file so you should be able to open your .ipynb notebook with a text editor and extract it from there (if it is saved).

---

<div class="post-metadata">

**Author:** ![Michael\_Barmann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/michael_barmann/32/20389_2.png) [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Post date:** [January 14, 2021, 8:41pm UTC](https://discourse.julialang.org/t/jupyter-ijulia-cell-containing-code-suddenly-turned-blank/53354/3 "2021-01-14T20:41:10Z")

</div>

Hi, thanks for your reply. Weirdly I can see the contents now. I highlighted the cell, went to the dropdown menu on the toolbar and selected “Raw NBConvert.” Except it’s not quite a normal cell now. I tried selecting “Code” and “header” from the dropdown menu also, and now it looks like this:

 ![Jupyter_cell](https://global.discourse-cdn.com/julialang/original/3X/0/9/09420260d704c9143c79fa3bc141c063be8f8307.png)

I have no idea what is going on…

I just reverted to the last checkpoint so I’m ok for now. But it’d be nice to know what I did to screw things up so I can avoid doing it again in the future.

---

<div class="post-metadata">

**Author:** ![Ian\_Slagle](https://avatars.discourse-cdn.com/v4/letter/i/b5a626/32.png) [@Ian\_Slagle](https://discourse.julialang.org/u/Ian_Slagle)\
**Post date:** [January 15, 2021, 9:34pm UTC](https://discourse.julialang.org/t/jupyter-ijulia-cell-containing-code-suddenly-turned-blank/53354/4 "2021-01-15T21:34:03Z")

</div>

> [@Michael\_Barmann](#):
>
> I have no idea what I did or how to get my code back. I think maybe I hit some keyboard shortcut by mistake? Does anyone know what this means, or how to get my code back? Here’s a screenshot:

I have also run into this issue (I think). Sometimes the cell becomes non-responsive, sometimes clicking adds a random subset of the text to the cell again, and usually after that all occurs for a bit, the cell goes blank. I have learned to just stop clicking and manually copy the text to the next cell and delete the original.

It’s hard to imagine a use case where this is actually desirable and intended behavior, but stranger things have happened before.

---

<div class="post-metadata">

**Author:** ![Ian\_Slagle](https://avatars.discourse-cdn.com/v4/letter/i/b5a626/32.png) [@Ian\_Slagle](https://discourse.julialang.org/u/Ian_Slagle)\
**Post date:** [January 15, 2021, 9:37pm UTC](https://discourse.julialang.org/t/jupyter-ijulia-cell-containing-code-suddenly-turned-blank/53354/5 "2021-01-15T21:37:25Z")

</div>

> [@Michael\_Barmann](#):
>
> I just reverted to the last checkpoint so I’m ok for now. But it’d be nice to know what I did to screw things up so I can avoid doing it again in the future.

It also seems like it would be browser-side rather than the notebook files messing up since

> [@xyz1](#):
>
> you should be able to open your .ipynb notebook with a text editor and extract it from there (if it is saved).

Which browser are you using? My issues happen on a Chrome variant (Brave). I have not investigated whether the same problems occur on other

---

<div class="post-metadata">

**Author:** ![Satvik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/satvik/32/20486_2.png) [@Satvik](https://discourse.julialang.org/u/Satvik)\
**Post date:** [January 15, 2021, 9:44pm UTC](https://discourse.julialang.org/t/jupyter-ijulia-cell-containing-code-suddenly-turned-blank/53354/6 "2021-01-15T21:44:51Z")

</div>

I remember a strange bug in Jupyter that caused this behavior if you hit “.0”: [https://github.com/codemirror/CodeMirror/issues/6288](https://github.com/codemirror/CodeMirror/issues/6288)

This should be fixed in later versions of jupyter, so try updating everything related to it, including the notebook, IJulia, etc. and see if that fixes the problem.

---

<div class="post-metadata">

**Author:** ![Michael\_Barmann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/michael_barmann/32/20389_2.png) [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Post date:** [January 18, 2021, 11:16pm UTC](https://discourse.julialang.org/t/jupyter-ijulia-cell-containing-code-suddenly-turned-blank/53354/8 "2021-01-18T23:16:39Z")

</div>

I’m using Firefox.

---

<div class="post-metadata">

**Author:** ![Michael\_Barmann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/michael_barmann/32/20389_2.png) [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Post date:** [January 18, 2021, 11:20pm UTC](https://discourse.julialang.org/t/jupyter-ijulia-cell-containing-code-suddenly-turned-blank/53354/9 "2021-01-18T23:20:28Z")

</div>

Hmm interesting. Thankfully, I don’t get an error when I type “.0”. Also, I’m using a very new installation of Jupyter notebook so I don’t think it’s the same bug.

---

<div class="post-metadata">

**Author:** ![Michael\_Barmann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/michael_barmann/32/20389_2.png) [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Post date:** [January 18, 2021, 11:22pm UTC](https://discourse.julialang.org/t/jupyter-ijulia-cell-containing-code-suddenly-turned-blank/53354/10 "2021-01-18T23:22:11Z")

</div>

I experienced exactly what you just described! And it happened again yesterday and I’m pretty sure I did not hit a keyboard shortcut. My current approach is to just save + checkpoint very often.

---

<div class="post-metadata">

**Author:** ![Michael\_Barmann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/michael_barmann/32/20389_2.png) [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Post date:** [January 23, 2021, 6:49pm UTC](https://discourse.julialang.org/t/jupyter-ijulia-cell-containing-code-suddenly-turned-blank/53354/11 "2021-01-23T18:49:10Z")

</div>

I’ve now had this issue occur 3 times in the last 15 minutes. How can we report this as a bug?

In the meantime, does anyone have any suggestions for alternatives to Jupyter notebook?

---

<div class="post-metadata">

**Author:** ![jbcaillau](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbcaillau/32/206767_2.png) [@jbcaillau](https://discourse.julialang.org/u/jbcaillau)\
**Post date:** [September 26, 2021, 10:36am UTC](https://discourse.julialang.org/t/jupyter-ijulia-cell-containing-code-suddenly-turned-blank/53354/12 "2021-09-26T10:36:10Z")

</div>

having the same issue on jupyter lab IJulia / kernel Julia 1.6.0 / iPadOS / Safari

Code not containing any .0

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [September 26, 2021, 1:44pm UTC](https://discourse.julialang.org/t/jupyter-ijulia-cell-containing-code-suddenly-turned-blank/53354/13 "2021-09-26T13:44:38Z")

</div>

> [@Michael\_Barmann](#):
>
> I’ve now had this issue occur 3 times in the last 15 minutes. How can we report this as a bug?

It’s probably a problem in the Julia mode of CodeMirror, which is the text editor used in Jupyter. If you can contrive a reproducible example (“type ‘x’ in Julia mode and the cell disappears”) you should file a [codemirror issue](https://github.com/codemirror/CodeMirror).
