Closed woodgreat closed 2 months ago
The JavaScript kernel runs in a web worker, where console
does not exist
so,how to do for it ?I need the answer .thank you!
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....
thanks!
The JavaScript kernel runs in a web worker, where
console
does not exist
how to start the web worker?
@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:
@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:
Closing as answered, but don't hesitate to open a new issue if you have more questions!
@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 👀
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.