Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not show outputs with JupyterLab 4.3.0b0 #26

Open
krassowski opened this issue Aug 12, 2024 · 1 comment
Open

Does not show outputs with JupyterLab 4.3.0b0 #26

krassowski opened this issue Aug 12, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@krassowski
Copy link
Collaborator

krassowski commented Aug 12, 2024

Description

Not sure where the contract is broken, probably on JupyterLab side but just as a heads up the outputs do not show up, an exception is thrown:

TypeError: e.toJSON is not a function
    at jlab_core.abd83dd7cfacd6da4d00.js?v=abd83dd7cfacd6da4d00:1:238328
    at 1168.8e5df3139aa020a611cb.js?v=8e5df3139aa020a611cb:1:551
    at q._onSharedModelChanged (jlab_core.abd83dd7cfacd6da4d00.js?v=abd83dd7cfacd6da4d00:1:238119)
    at m (jlab_core.abd83dd7cfacd6da4d00.js?v=abd83dd7cfacd6da4d00:1:1838868)
    at Object.l [as emit] (jlab_core.abd83dd7cfacd6da4d00.js?v=abd83dd7cfacd6da4d00:1:1838544)
    at a.emit (jlab_core.abd83dd7cfacd6da4d00.js?v=abd83dd7cfacd6da4d00:1:1836381)
    at Array._modelObserver (1168.8e5df3139aa020a611cb.js?v=8e5df3139aa020a611cb:1:7524)
    at Object.r (383.db345dbeef5ef774e50c.js?v=db345dbeef5ef774e50c:1:936)
    at ji (383.db345dbeef5ef774e50c.js?v=db345dbeef5ef774e50c:1:43499)
    at Array.<anonymous> (383.db345dbeef5ef774e50c.js?v=db345dbeef5ef774e50c:1:52559)

Reproduce

  • Install pip install jupyter_server_nbmodel[lab] jupyterlab>=4.3.0b0 jupyter-ydoc>=3.0.0a3
  • Run cell with 1 + 1
  • See no output

Expected behavior

2

Context

@krassowski krassowski added the bug Something isn't working label Aug 12, 2024
@krassowski
Copy link
Collaborator Author

It looks like we've got quite some work to do here:

# FIXME support for version
output = nbformat.v4.output_from_msg(msg)
outputs.append(output)
if ycell is not None:
cell_outputs = ycell["outputs"]
if msg_type == "stream":
with cell_outputs.doc.transaction():
text = output["text"]
# FIXME Logic is quite complex at https://github.com/jupyterlab/jupyterlab/blob/7ae2d436fc410b0cff51042a3350ba71f54f4445/packages/outputarea/src/model.ts#L518
if text.endswith((os.linesep, "\n")):
text = text[:-1]
if (not cell_outputs) or (cell_outputs[-1]["name"] != output["name"]):
output["text"] = [text]
cell_outputs.append(output)
else:
last_output = cell_outputs[-1]
last_output["text"].append(text)
cell_outputs[-1] = last_output
else:
with cell_outputs.doc.transaction():
cell_outputs.append(output)
elif msg_type == "clear_output":
# FIXME msg.content.wait - if true should clear at the next message
outputs.clear()
if ycell is not None:
del ycell["outputs"][:]
elif msg_type == "update_display_data":
# FIXME
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant