-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fetch and http request #80
Comments
Hi, thanks for reporting this. A few questions:
A suggestion would be to just use the |
directly
I'll check - but it should be very easy to reproduce
localhost: same url as I am using in the request
OK :) |
It seems there are "two" errors - at least error messages but the result is OK. Even with requests I get the error mentioned above in the cell output if I wrap requests in an async function and await it:
Without async I just get an error in the browser console:
I am using async function sin a library because I use micropip and I'd like to make my library work with both kernels. |
I can confirm that toplevel awaits are not working atm Ie: async def foo():
# your code here
asyncio.create_task(foo()) |
I will probably be able to add a fix in the next days |
Thank you @DerThorsten. OT: I have tested xeus vs pyodide and I hope I can keep xeus. Being able to just provide the environment without extra installs is very useful. |
this is fixed (a patch in IPython needed to be updated) To use this, you will need the most recent build of IPython (ipython=8.22.2=py311had7285e_1). This is the script I used to create working build WASM_ENV_NAME=my-env-name
WASM_ENV_PREFIX=$MAMBA_ROOT_PREFIX/envs/$WASM_ENV_NAME
micromamba create -n $WASM_ENV_NAME \
--platform=emscripten-wasm32 \
-c https://repo.mamba.pm/emscripten-forge \
-c https://repo.mamba.pm/conda-forge \
--yes \
xeus-python "ipython=8.22.2=py311had7285e_1" "traitlets>=5.14.2"
jupyter lite build \
--XeusAddon.prefix=$WASM_ENV_PREFIX |
Thanks for the additional hints. I'll give it a try. |
there is still a tiny issue, atm you need to import |
The ipython build with the fix : therefore the updated snipped is: WASM_ENV_NAME=my-env-name
WASM_ENV_PREFIX=$MAMBA_ROOT_PREFIX/envs/$WASM_ENV_NAME
micromamba create -n $WASM_ENV_NAME \
--platform=emscripten-wasm32 \
-c https://repo.mamba.pm/emscripten-forge \
-c https://repo.mamba.pm/conda-forge \
--yes \
xeus-python "ipython=8.22.2=py311had7285e_2" "traitlets>=5.14.2"
jupyter lite build \
--XeusAddon.prefix=$WASM_ENV_PREFIX |
A follow up on jupyterlite/pyodide-kernel#96
Description
I tried xeus because adding additional pkgs seems far easier then in pyodide. But I ran into issues with network requests.
Reproduce
Using fetch seems to work in principle but gave me this error:
Then I tried
httpx
which seems to require openssl (I added it to my environment.yml). This made the kernel unusable with the condole error:LinkError: WebAssembly.instantiate(): Import #92 module="env" function="time": imported function does not match the expected type
. Complete output below.I can confirm that
requests
lib works but I could not test it with https so far.Context
Browser Output
The text was updated successfully, but these errors were encountered: