File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -436,6 +436,37 @@ for the main thread to call functions defined in the worker in a non-blocking
436436manner, thus allowing the worker to also work in an unblocked manner and react
437437to such calls. We have resolved the mutual deadlock.
438438
439+ ### TypeError: crypto.randomUUID is not a function
440+
441+ If PyScript fails to start and you look in the browser console, you may
442+ find the following error:
443+
444+ !!! failure
445+
446+ ```
447+ main.js:43 Uncaught TypeError: crypto.randomUUID is not a function
448+ at main.js:43:26
449+ ```
450+
451+ #### When
452+
453+ This happens because PyScript uses the ` crypto.randomUUID ` function, and the
454+ web page isn't served correctly.
455+
456+ #### Why
457+
458+ This error is _ created by the browser_ because ` crypto.randomUUID ` requires a
459+ secure context or localhost to use the latest web standards that are part of
460+ PyScript's core (such as ` crypto.randomUUID ` ).
461+
462+ Put simply, your code should be served from a domain secured
463+ with TLS (i.e. the domain name starts with ` https ` - use a service like
464+ [ let's encrypt] ( https://letsencrypt.org/ ) to address this) or from ` localhost `
465+ if developing and viewing your site on your development machine.
466+
467+ This is something PyScript can't fix. Rather, it's how the web works and you
468+ should always ensure your code is served in a secure manner.
469+
439470## Helpful hints
440471
441472This section contains common hacks or hints to make using PyScript easier.
You can’t perform that action at this time.
0 commit comments