Skip to content

Conversation

@sloisel
Copy link

@sloisel sloisel commented Nov 24, 2025

I must apologize for the following. I'd like to think I'm a competent programmer (I'm a former NVidia dev, now a math prof), but this is 2025 and I have shamefully vibe-coded this PR with Claude Code because I have no idea how Bonito works. Nevertheless, it seems to work for me and allows WGLMakie use in Jupyter Lab. I hope you will find it useful!

Sincerely,

S. Loisel


Summary

This PR fixes JupyterLab support which has been broken due to incorrect proxy URL generation.

Changes

  • Fix proxy URL: jupyter-server-proxy mounts at /proxy/ on the server root, not under base_url (e.g., /lab/). The previous code generated URLs like http://127.0.0.1:8888/lab/proxy/9384 when it should be http://127.0.0.1:8888/proxy/9384.

  • Add find_jupyter_executable() fallback: If IJulia's configured jupyter path doesn't exist (e.g., points to a non-existent conda environment), fall back to finding jupyter in PATH.

  • Wrap jupyter_running_servers() in try-catch: Prevents display crashes if the jupyter command fails.

  • Documentation: Document JupyterLab's jupyter-server-proxy requirement in deployment.md.

Test plan

  • Tested with local JupyterLab (homebrew install)
  • Verified Bonito apps display correctly
  • Verified WGLMakie plots render in JupyterLab

- Fix proxy URL: jupyter-server-proxy mounts at /proxy/ on server root,
  not under base_url (e.g., /lab/). This was causing WebSocket connections
  to fail in JupyterLab.

- Add find_jupyter_executable() fallback: If IJulia's configured jupyter
  path doesn't exist (e.g., points to non-existent conda env), fall back
  to finding jupyter in PATH.

- Wrap jupyter_running_servers() in try-catch to prevent display crashes
  if jupyter command fails.

- Document JupyterLab's jupyter-server-proxy requirement in deployment.md.
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

Successfully merging this pull request may close these issues.

1 participant