jupyter-widgets / ipydatagrid

Fast Datagrid widget for the Jupyter Notebook and JupyterLab
BSD 3-Clause "New" or "Revised" License
579 stars 51 forks source link

unknown extension in voila #435

Closed eyalk11 closed 1 year ago

eyalk11 commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

Voila returns unknown extension , whereas it works in jupyter lab. Could be a voila bug.

On windows, python 3.9.6

IPython          : 8.15.0
ipykernel        : 6.21.3
ipywidgets       : 8.1.0
jupyter_client   : 8.3.1
jupyter_core     : 5.3.1
jupyter_server   : 2.7.3
jupyterlab       : 4.0.5
nbclient         : 0.7.2
nbconvert        : 7.2.10
nbformat         : 5.7.3
notebook         : 7.0.3
qtconsole        : 5.4.1
traitlets        : 5.9.0

voila                          0.5.1
ipydatagrid                    1.1.16

got javascript error:

Error: No version of module ipydatagrid is registered
    at _.loadClass (7018.voila.js:1:77776)
    at _.loadModelClass (7018.voila.js:1:74726)
    at _._make_model (7018.voila.js:1:71514)
    at _.new_model (7018.voila.js:1:69103)
    at 7018.voila.js:1:70382
    at Array.map (<anonymous>)
    at _._loadFromKernel (7018.voila.js:1:70275)
    at async _.restoreWidgets (7018.voila.js:1:79265)
console.error @ (index):41
loadModelClass @ 7018.voila.js:1
await in loadModelClass (async)
_make_model @ 7018.voila.js:1
new_model @ 7018.voila.js:1
(anonymous) @ 7018.voila.js:1
_loadFromKernel @ 7018.voila.js:1
await in _loadFromKernel (async)
_loadFromKernel @ 7018.voila.js:1
restoreWidgets @ 7018.voila.js:1
_ @ 7018.voila.js:1
activate @ 8113.voila.js:1
await in activate (async)
(anonymous) @ 6219.voila.js:1
Promise.then (async)
activatePlugin @ 6219.voila.js:1
(anonymous) @ 6219.voila.js:1
start @ 6219.voila.js:1
(anonymous) @ 5544.voila.js:1
load (async)
75544 @ 5544.voila.js:1
p @ voila.js:1
Promise.then (async)
37559 @ voila.js:1
p @ voila.js:1
(anonymous) @ voila.js:1
(anonymous) @ voila.js:1
(index):41 Error: No version of module @jupyter-widgets/base is registered
    at _.loadClass (7018.voila.js:1:77776)
    at _.loadModelClass (7018.voila.js:1:74726)
    at _._make_model (7018.voila.js:1:71514)
    at _.new_model (7018.voila.js:1:69103)
    at 7018.voila.js:1:70382
    at Array.map (<anonymous>)
    at _._loadFromKernel (7018.voila.js:1:70275)
    at async _.restoreWidgets (7018.voila.js:1:79265)

To Reproduce Use the following notebook:

import pandas as pd

# Create a simple dataframe
data = {
    'Name':['Tom', 'Nick', 'John', 'Tom'],
    'Age':[20, 21, 19, 20],
    'City':['New York', 'London', 'New Jersey', 'Sydney']
}

df = pd.DataFrame(data)

from ipydatagrid import DataGrid
Datagrid(df)

python -m voila --show_tracebacks=True compare-my-stocks\src\compare_my_stocks\data\jupyter\Untitled.ipynb

martinRenou commented 1 year ago

Thanks for opening an issue, would you be able to provide more JavaScript traceback?

eyalk11 commented 1 year ago
Refused to execute script from 'http://localhost:8866/voila/labextensions/@jupyter-widgets/jupyterlab-manager/static/remoteEntry.98b8a827bfc5f86e95d2.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.

Yeh, apparently it works in edge and Firefox . Just not in chrome.

I tried the solution here : https://github.com/jupyterlab/jupyterlab/issues/6098

Still not working in chrome. Not your bug, I think :)

PS. if you are a maintainer of voila , then it might be related. Though I am not sure yet.