tabulator doesn't work in an offline notebook context #3959
Description
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/tabulator-tables@4.9.3/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:
Network tab in firefox developer tools showing the cdn requests
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/tabulator-tables@4.9.3/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/tabulator-tables@4.9.3/dist/css/tabulator.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/tabulator.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/tabulator_midnight.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/tabulator_midnight.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/tabulator_modern.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/tabulator_modern.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/tabulator_simple.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/tabulator_simple.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/tabulator_site.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/tabulator_site.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/bootstrap/tabulator_bootstrap.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/bootstrap/tabulator_bootstrap.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/bootstrap/tabulator_bootstrap4.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/bootstrap/tabulator_bootstrap4.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/bulma/tabulator_bulma.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/bulma/tabulator_bulma.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/fast/tabulator_fast.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/materialize/tabulator_materialize.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/materialize/tabulator_materialize.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/semantic-ui/tabulator_semantic-ui.min.css
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/semantic-ui/tabulator_semantic-ui.min.css.map
pyenv3.9/lib/python3.9/site-packages/panel/dist/bundled/datatabulator/tabulator-tables@4.9.3/dist/js/tabulator.js
Activity