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

(jupyter) Console log in jupyter notebook prints only last message #24437

Closed
zph opened this issue Jul 4, 2024 · 11 comments
Closed

(jupyter) Console log in jupyter notebook prints only last message #24437

zph opened this issue Jul 4, 2024 · 11 comments
Labels
bug Something isn't working correctly deno jupyter Related to "deno jupyter" subcommand

Comments

@zph
Copy link
Contributor

zph commented Jul 4, 2024

Versions of Deno affected (non-exhaustive):

  • 8fcc263 near tip of main
  • 1.44.4
  • 1.43.6

Working versions:

  • 1.43.5
  • 1.43.3
  • 1.43.0
  • 1.42.4
  • (etc)

The regression occurred between v1.43.5 and 1.43.6: v1.43.5...v1.43.6

Expected behavior: console.log will print all messages from a cell
image

Actual behavior: console.log prints only last message from a cell

image

The changes to jupyter occurred in: 93d7b37 as part of refactoring the jupyter integration.

@rgbkrk Do you have a hunch about where this is happening since you authored the work in 93d7b37?

@bartlomieju bartlomieju added bug Something isn't working correctly deno jupyter Related to "deno jupyter" subcommand labels Jul 4, 2024
@rgbkrk
Copy link
Contributor

rgbkrk commented Jul 5, 2024

Yeah this is bound to be in that stdio sender. Working on reproducing now.

@rgbkrk
Copy link
Contributor

rgbkrk commented Jul 5, 2024

This only reproduces in VS Code. In Jupyterlab, classic, and Zed Nightly it all displays normally.

VS Code

image

Zed Nightly

image

Jupyter Lab

image

@lucacasonato
Copy link
Member

@rgbkrk Is this something we should change in deno jupyter, or do you think this is an upstream VS Code issue?

@rgbkrk
Copy link
Contributor

rgbkrk commented Jul 9, 2024

It looks like it's on the VS Code side. I'll dig in to find out why though as all clients should be treating the protocol the same.

@sinedied
Copy link

Can it also be the reason why errors are not being displayed in the console?

image

I'm only using VS Code and currently I'm unable to see errors in code cells. Let me know if you think I should open a separate issue, but I may get nothing because only the last print (newline?) is shown.

@mrbelderock
Copy link

Just commenting to say I have the same issue. VSCode, Deno 1.44.1 - console.log prints only last line and (so?) errors don't print either.

@rgbkrk
Copy link
Contributor

rgbkrk commented Jul 15, 2024

@DonJayamanne -- I haven't discovered yet why VS Code is treating messages differently than other jupyter frontends. Can you check this out?

@sinedied
Copy link

I have an extra hint that may be useful for the investigation: it's not only the last log that is shown, but only the last one from the same tick.

The following code:

console.log("1");
console.log("2");
window.setTimeout(() => {
  console.log("3");
});

outputs

2
3

in VS Code. So console logs in different ticks are still visible.

@DonJayamanne
Copy link
Contributor

Root cause is here, #24737
Apologies for taking so long

@rgbkrk
Copy link
Contributor

rgbkrk commented Jul 26, 2024

Egg on my face, I'm going to go fix this now.

@bartlomieju
Copy link
Member

Closed in #24762

crowlKats pushed a commit that referenced this issue Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly deno jupyter Related to "deno jupyter" subcommand
Projects
None yet
Development

No branches or pull requests

7 participants