Open c0mm4nd opened 3 months ago
@c0mm4nd Yes, that behavior is similar to what is described in https://github.com/datalayer-examples/jupyter-nextjs-example/issues/4
JupyterLab and JupyterLite strongly rely on webpack. There should be a way to avoid those error messages. I have tried but not yet found a solution. The issue is at the instersection of next.js and webpack.js
Still the notebook is running fine. The production build works fine also for me.
btw after yarn build
, yarn start
does not give those error messages
I just tried the lite={true}
as decribed in https://jupyter-ui.datalayer.tech/docs/components/notebook/#with-in-browser-kernel
The Notebook seems crashed.
error:
kernel.js:52 Uncaught (in promise) PythonError: Traceback (most recent call last):
File "/lib/python311.zip/_pyodide/_base.py", line 573, in eval_code_async
await CodeRunner(
File "/lib/python311.zip/_pyodide/_base.py", line 395, in run_async
await coroutine
File "<exec>", line 3, in <module>
File "/lib/python3.11/site-packages/micropip/_commands/install.py", line 142, in install
await transaction.gather_requirements(requirements)
File "/lib/python3.11/site-packages/micropip/transaction.py", line 204, in gather_requirements
await asyncio.gather(*requirement_promises)
File "/lib/python3.11/site-packages/micropip/transaction.py", line 217, in add_requirement
await self.add_wheel(wheel, extras=set(), specifier="")
File "/lib/python3.11/site-packages/micropip/transaction.py", line 383, in add_wheel
await wheel.download(self.fetch_kwargs)
File "/lib/python3.11/site-packages/micropip/transaction.py", line 100, in download
with ZipFile(data) as zip_file:
^^^^^^^^^^^^^
File "/lib/python311.zip/zipfile.py", line 1301, in __init__
self._RealGetContents()
File "/lib/python311.zip/zipfile.py", line 1368, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
at new_error (pyodide.asm.js:9:10014)
at pyodide.asm.wasm
at pyodide.asm.wasm
at _PyEM_TrampolineCall_JS (pyodide.asm.js:9:120223)
at pyodide.asm.wasm
at pyodide.asm.wasm
at pyodide.asm.wasm
at pyodide.asm.wasm
at pyodide.asm.wasm
at pyodide.asm.wasm
at pyodide.asm.wasm
at pyodide.asm.wasm
at pyodide.asm.wasm
at pyodide.asm.wasm
at pyodide.asm.wasm
at Module.callPyObjectKwargs (pyodide.asm.js:9:64297)
at Module.callPyObject (pyodide.asm.js:9:65365)
at wrapper (pyodide.asm.js:9:32855)
There is a 404 error in the Network panel, requesting http://localhost:3000/_next/pypi/piplite-0.2.3-py3-none-any.whl
The source code of the notebook component (no any other change):
'use client'
import { Jupyter, Notebook, CellSidebar } from '@datalayer/jupyter-react';
export const NotebookComponent = () => {
return (
<>
<div style={{fontSize: 20}}>Jupyter Notebook in Next.js</div>
<Jupyter
lite={true}
>
<Notebook
ipywidgets={'classic'}
nbformat={{
cells: [
{
cell_type: 'code',
outputs: [],
source: 'print("Hello, World!")',
}
],
metadata: {
kernelspec: {
display_name: 'Python 3 (ipykernel)',
language: 'python',
name: 'python3',
},
},
nbformat: 4,
nbformat_minor: 5,
}}
/>
</Jupyter>
</>
)
}
export default NotebookComponent;
same to what I said in https://github.com/datalayer/jupyter-ui/issues/252
UI and notebook are working fine in the browser.