PyScript configuration: Pyodide package loading and CORS restrictions
0 reputation · 20 Oct 2021, 18:49 UTC
PyScript utilizes a configuration file to define the necessary Pyodide packages and custom Python modules required for the runtime environment. Because the execution occurs within a sandboxed browser environment via WebAssembly, the loading process is subject to browser security policies.
When specifying external dependencies or custom modules in the configuration, the interaction between the PyScript runtime and the remote server must adhere to Cross-Origin Resource Sharing (CORS) requirements. There is uncertainty regarding the behavior of the runtime when a specified package is available but the server headers restrict the request.
- Does the PyScript runtime provide a specific mechanism to handle CORS preflight failures during the initial package loading phase?
- How does the runtime distinguish between a missing package and a package blocked by browser security policies in the configuration log?