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 widget breaks on non-localhost http jupyters #244

Closed
frtennis1 opened this issue Dec 29, 2023 · 0 comments · Fixed by #245
Closed

Jupyter widget breaks on non-localhost http jupyters #244

frtennis1 opened this issue Dec 29, 2023 · 0 comments · Fixed by #245

Comments

@frtennis1
Copy link
Contributor

If you run Jupyter either over https or on localhost, you don't get this bug. But when you're on a remote using http (or on your localhost, but aliased), the widget breaks with,

Uncaught (in promise) TypeError: globalThis.crypto.randomUUID is not a function
    at s (5ca03b59-285e-488c-b59a-ef82c3b57b2c:37017:33)
    at 5ca03b59-285e-488c-b59a-ef82c3b57b2c:37022:36
    at new Promise (<anonymous>)
    at Object.query (5ca03b59-285e-488c-b59a-ef82c3b57b2c:37022:14)
    at u (5ca03b59-285e-488c-b59a-ef82c3b57b2c:8429:48)
    at a (5ca03b59-285e-488c-b59a-ef82c3b57b2c:8409:9)
    at c (5ca03b59-285e-488c-b59a-ef82c3b57b2c:8414:21)
    at Object.add (5ca03b59-285e-488c-b59a-ef82c3b57b2c:8209:134)
    at Object.request (5ca03b59-285e-488c-b59a-ef82c3b57b2c:8450:20)
    at sL.query (5ca03b59-285e-488c-b59a-ef82c3b57b2c:8527:25)

Some research suggests that browsers do not give access to the crypto api outside of "secure contexts" https://stackoverflow.com/questions/105034/how-do-i-create-a-guid-uuid,

crypto.randomUUID() is now standard on all modern browsers and JS runtimes. However, because new browser APIs are restricted to secure contexts, this method is only available to pages served locally (localhost or 127.0.0.1) or over HTTPS.

and perhaps a recommended fix would be to replace the single callsite with the recommended uuid module from that stackoverflow answer.

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 a pull request may close this issue.

1 participant