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

Rendered pages do not rewrite relative URLs in jupyter-config-data #137

Open
bollwyvl opened this issue Jan 12, 2025 · 0 comments · May be fixed by #138
Open

Rendered pages do not rewrite relative URLs in jupyter-config-data #137

bollwyvl opened this issue Jan 12, 2025 · 0 comments · May be fixed by #138
Labels
bug Something isn't working

Comments

@bollwyvl
Copy link

thanks for voici!

Description

Extensions that rely on *Url and *Urls config settings are incorrect when loaded in rendered voici_core pages.

Reproduce

  • make a lite site with an extension that uses site-relative paths, e.g. jupyterlite-pyodide-kernel's pyodideUrl
  • try to do something that uses that URL (like start a kernel)
  • see 404s
Uncaught (in promise) NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': 
  The script at 'http://127.0.0.1:8000/voici/render/static/pyodide/pyodide.js' failed to load.
    at gt.initRuntime (352.3014c3141745cb055fab.js?v=3014c3141745cb055fab:2:105293)
    at gt.initialize (352.3014c3141745cb055fab.js?v=3014c3141745cb055fab:2:104999)
    at a (352.3014c3141745cb055fab.js?v=3014c3141745cb055fab:2:101679)

In the above page, the baseUrl is correctly set in jupyter-config-data to ../../, but ./static/pyodide/pyodide.js (instead of "../../static/pyodide/pyodide.js") is being requested.

Expected behavior

The path normalization applied by config-utils.js handles this for the general case, including merging site-level customizations, etc. Just "not doing it" means it is likely a number of other things that rely on relative paths during a deployment will break.

Context

  • voila version: n/a
  • Operating System and version: ubuntu linux 24.04
  • Browser and version: all
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `voila` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here.
@bollwyvl bollwyvl added the bug Something isn't working label Jan 12, 2025
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

Successfully merging a pull request may close this issue.

1 participant