jupyterlite / javascript-kernel

A simple JavaScript kernel for JupyterLite, running in a Web Worker
https://jupyterlite.github.io/javascript-kernel/
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

can't work,Pls tell me why? #16

Closed woodgreat closed 2 months ago

woodgreat commented 3 months ago

20240704190405

martinRenou commented 3 months ago

The JavaScript kernel runs in a web worker, where console does not exist

woodgreat commented 3 months ago

so,how to do for it ?I need the answer .thank you!

DerThorsten commented 3 months ago

so,how to do for it ?I need the answer .thank you!

you can try xeus-javascript https://github.com/jupyter-xeus/xeus-javascript, console.log works there.

@martinRenou console.log usually does work in a worker....

woodgreat commented 3 months ago

thanks!

woodgreat commented 3 months ago

The JavaScript kernel runs in a web worker, where console does not exist

how to start the web worker?

jtpio commented 2 months ago

@woodgreat according to the screenshot it looks like you are trying to run JavaScript code in a regular JupyterLab with a Python kernel? (since there is the extension manager panel on the left).

I get the same error when trying to execute the same code snippet with ipykernel:

image

jtpio commented 2 months ago

@woodgreat if you want to use the JavaScript kernel, you can for example open https://jupyterlite.github.io/demo/lab/index.html in a browser tab, and make sure you have selected "JavaScript (Web Worker)" as the kernel:

image

Closing as answered, but don't hesitate to open a new issue if you have more questions!

martinRenou commented 2 months ago

@martinRenou console.log usually does work in a worker

I assumed it would not work, sorry for the confusion!

The Python traceback formatting should have been another hint 👀

woodgreat commented 2 months ago

Thank YOU ! finally,i know why i can not use it .i should use jupyterlite instead of the lab ,so i keep learning of it, thank you.