Perspective 1.0.2 and above does not work in Voila
Bug Report
Steps to Reproduce:
- Open a Jupyter notebook that uses PerspectiveWidget in Jupyterlab, where it renders correctly.
- Render the same notebook using Voila.
Expected Result:
Working PerspectiveWidget instances.
Actual Result:
PerspectiveWidget can not be registered in Voila.

Environment:
Perspective > 1.0.1, Any OS, Voila 0.3.3 (same version for preview)
Additional Context:
Perspective Jupyterlab is now bundled as an ECMAScript module, and can not be loaded through requireJs into Voila. This is related to #1611
@finos/perspective-jupyterlab is not bundled as an ECMAScript module - it uses the esbuild "esm" format but this is an implementation detail as the bundle contains no import nor export statements.
From the error screenshot, it looks like Voila is trying to load the plugin from CDN and using the wrong path (dist vs dist/umd as per the package.json main field). @timkpaine is this a Voila gotcha?
https://github.com/voila-dashboards/voila/blob/main/packages/voila/src/loader.ts#L44
i can probably update voila to check for the main of the package.json
May be a bit more complex than that, as the general rules for module resolution are somewhat arbitrary (e.g. jsdelivr also respects a jsdelivr field when present, and newer versions introduce exports etc).
The error seems to indicate fetching from a CDN is an exception rather than the norm - would this be resolved by disting the plugin with perspective-python?
If I just change the output location to dist, this will work I assume?
https://github.com/finos/perspective/issues/467
https://github.com/finos/perspective/issues/442
original: https://github.com/finos/perspective/pull/335
Not sure switching the output to a dist/index.js would solve the issue.
We can configure require for voila to fetch the asset from the valid path :
requirejs.config({ paths: { '@finos/perspective-jupyterlab': 'https://cdn.jsdelivr.net/npm/@finos/[email protected]/dist/umd/perspective-jupyterlab' } });
Then we get the below error in the console.

Same problem here, Perspective is working fine through JupyterLab, but inside Voila he is trying to get dist/index.js from CDN and it's no loger available since 1.0.2 .
What I tried is to pass option enable_nbextensions=True to Voila, hoping that it could retrieve perspective-jupyterlab.js from local disk but it didn't work..

I can locate the file in /usr/local/share/jupyter/lab/staging/node_modules/@finos/perspective-jupyterlab/dist/umd/perspective-jupyterlab.js surely because I installed labextension (the npm part) and rebuilt jupyter, but voila doesn't seems to find it.
Anyone did find a working solution? In meanwhile I'll be stick with the 1.0.1 ...
There is no workaround, we can fix the cdn location but the best solution is for me to finish the prebuilt extension which will let it find perspective on disk.
Has there been any progress on this ticket?
@timkpaine Is resolution of this issue waiting on approval of your PR for voila issue 1154?
Any updates here?
should work after https://github.com/finos/perspective/pull/2136