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

Example in Docs of Javascript to Julia is not working in JupyterLab Notebook #491

Open
davibarreira opened this issue May 12, 2022 · 1 comment

Comments

@davibarreira
Copy link

The bug

This example of Javascript to Julia is not working in Jupyter. The buttom is rendered, but once clicked, nothing is printed.

scope = Scope()
obs = Observable(scope, "rand-value", 0.0)

on(obs) do x
    println("JavaScript sent $(x)!")
end

scope(
    dom"button"(
        "Generate Random Number",
        events=Dict("click" => @js () -> $obs[] = Math.random()),
    ),
)

image

Context

Pkg.status("WebIO")

Project LuxorInteractive v0.1.0
      Status `~/MEGA/EMAp/LuxorInteractive.jl/Project.toml`
  [0f1e0344] WebIO v0.8.17

versioninfo()

Julia Version 1.7.1
Commit ac5cc99908 (2021-12-22 19:35 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 4
  JULIA_EDITOR = lvim

jupyter labextension list

JupyterLab v3.3.2
/home/davibarreira/anaconda3/share/jupyter/labextensions
        jupyterlab-jupytext v1.3.1 enabled OK (python, jupytext)
        nbdime-jupyterlab v2.1.0 enabled OK
        webio-jupyterlab-provider v0.1.0 enabled OK (python, webio_jupyter_extension)
        @jupyter-widgets/jupyterlab-manager v3.0.1 enabled OK (python, jupyterlab_widgets)

Other labextensions (built into JupyterLab)
   app dir: /home/davibarreira/anaconda3/share/jupyter/lab
        @axlair/jupyterlab_vim v0.13.4 enabled OK
        jupyterlab-plotly v5.7.0 enabled OK
@davibarreira
Copy link
Author

The package works when I run a brand new notebook. Yet, once I restart the kernel, it stops working. It does not work ever again, even if I restart jupyter or even reinstall the whole thing. Thus, I need to create a new notebook every time in order to get it to work.

I figure the issue is not actually the WebIO.jl package, but something with my jupyter/system configuration. If you guys know anything about this issue, I'd love some help. Tried reinstalling everything, to no avail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant