Skip to content
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

tabulator doesn't work in an offline notebook context #3959

Open
pankajp opened this issue Oct 4, 2022 · 4 comments · May be fixed by #6607
Open

tabulator doesn't work in an offline notebook context #3959

pankajp opened this issue Oct 4, 2022 · 4 comments · May be fixed by #6607
Labels
component: tabulator Related to the Tabulator widget type: bug Something isn't correct or isn't working

Comments

@pankajp
Copy link

pankajp commented Oct 4, 2022

Panel already bundles in the tabulator extension js/css dependencies, but somehow it is not used in inline mode in a jupyter notebook, which makes it not work without internet connectivity.

xref: holoviz/holoviews#5469 (comment)

ALL software version info

Python: 3.9
panel: 0.13.1

Description of expected behavior and the observed behavior

Expected behavior: a tabulator based widget should show up with the data from the dataframe.
Observed behavior: Blank output: panel fails loading the tabulator files since they are requested from cdn which is not accessible without internet connection

Complete, minimal, self-contained example code that reproduces the issue

In a jupyter notebook in a browser without internet access. Easiest way to get it it to start firefox as follows (linux):

$ env http_proxy=http://localhost:1/ https_proxy=http://localhost:1/ firefox --profile nointernet

# notebook code
import pandas as pd
df = pd.DataFrame({'a':range(10),'b':range(10,20)})
import panel as pn
print(pn.__version__)
pn.extension('tabulator', inline=True)
display(pn.widgets.Tabulator(df))

Stack traceback and/or browser JavaScript console output

Following traceback along with other content

Loading failed for the <script> with source “https://unpkg.com/[email protected]/dist/js/tabulator.js”. sample-notebook-py3.9.ipynb:1:1
Uncaught Error: Script error for "tabulator"
http://requirejs.org/docs/errors.html#scripterror
    makeError http://localhost:8889/static/components/requirejs/require.js?v=d37b48bb2137faa0ab98157e240c084dd5b1b5e74911723aa1d1f04c928c2a03dedf922d049e4815f7e5a369faa2e6b6a1000aae958b7953b5cc60411154f593:168
    onScriptError http://localhost:8889/static/components/requirejs/require.js?v=d37b48bb2137faa0ab98157e240c084dd5b1b5e74911723aa1d1f04c928c2a03dedf922d049e4815f7e5a369faa2e6b6a1000aae958b7953b5cc60411154f593:1735
    load http://localhost:8889/static/components/requirejs/require.js?v=d37b48bb2137faa0ab98157e240c084dd5b1b5e74911723aa1d1f04c928c2a03dedf922d049e4815f7e5a369faa2e6b6a1000aae958b7953b5cc60411154f593:1940
    load http://localhost:8889/static/components/requirejs/require.js?v=d37b48bb2137faa0ab98157e240c084dd5b1b5e74911723aa1d1f04c928c2a03dedf922d049e4815f7e5a369faa2e6b6a1000aae958b7953b5cc60411154f593:1682
require.js:168:17

Screenshots or screencasts of the bug in action

Notebook:
image
Network tab in firefox developer tools showing the cdn requests
image

Here are the files tabulator files already bundled with panel:

$ find pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/ -type f
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/npm/@holoviz/panel/dist/bundled/[email protected]/dist/css/fast/tabulator_fast.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/npm/luxon/build/global/luxon.min.js
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/npm/luxon/build/global/luxon.min.js.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/tabulator.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/tabulator.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/tabulator_midnight.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/tabulator_midnight.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/tabulator_modern.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/tabulator_modern.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/tabulator_simple.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/tabulator_simple.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/tabulator_site.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/tabulator_site.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/bootstrap/tabulator_bootstrap.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/bootstrap/tabulator_bootstrap.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/bootstrap/tabulator_bootstrap4.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/bootstrap/tabulator_bootstrap4.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/bulma/tabulator_bulma.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/bulma/tabulator_bulma.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/fast/tabulator_fast.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/materialize/tabulator_materialize.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/materialize/tabulator_materialize.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/semantic-ui/tabulator_semantic-ui.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/css/semantic-ui/tabulator_semantic-ui.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/[email protected]/dist/js/tabulator.js
@pankajp
Copy link
Author

pankajp commented Oct 5, 2022

Duplicate of #3013

@pankajp pankajp closed this as completed Oct 5, 2022
@pankajp
Copy link
Author

pankajp commented May 30, 2023

This isn't fixed by the closing of the duplicate issue so reopening it.

@pankajp pankajp reopened this May 30, 2023
@hoxbro
Copy link
Member

hoxbro commented May 30, 2023

Can you try to upgrade to a newer version of Panel?

@pankajp
Copy link
Author

pankajp commented May 30, 2023

I checked it with the just released v1.0.3

@maximlt maximlt added type: bug Something isn't correct or isn't working component: tabulator Related to the Tabulator widget labels Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tabulator Related to the Tabulator widget type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants