[Solved by complete reinstall into new venv] Plotly no longer working in notebooks exported to html

As of Plotly 6+ with Jupyterlab 4.3.5 (4.4 as well) when a notebook is exported to html the Plotly widgets are not rendered. They do render properly upon opening the notebook in Jupyterlab. I get one warning on the html pages which may be the issue:

Source map error: Error: NetworkError when attempting to fetch resource.
Resource URL: https://unpkg.com/@jupyter-widgets/html-manager@*/dist/embed-amd.js
Source Map URL: embed-amd-render.js.map

Any ideas if this a settings issue in the export tools or a Plotly widget issue?

Thanks for any hints on figuring this out.

Another observation. It appears that in the saved html, the long lines in the dataset json for the plotly figurewidget are incomplete. The data in the middle of the lines appears to have been replaced with ellipses (…). Again, I am not sure which part of the code handling the conversion may be doing this.

I wonder if it may be related to these two plotly.js pull requests discussed here in answer to this SO question posted May 11th ‘converting jupyter notebook (.ipynb) with to HTML using nbconvert - plotly figures not showing’?
Both of those pull requests have ‘AMD’ in the title and your issue has embed-amd.js.
That answer said updating fixed things, but you already seem to be using 6+?

@fomightez as usual, even when you do not have a solution your suggestions lead in a good direction. A little more investigation along these lines made it clear that there was one or more hidden dependencies that were not met. It appears that plotly or one of its dependencies does not include up-to-date dependencies. The problem was solved by doing a complete reinstall into a new virtual environment. In the installations that were having problems there was no indication of dependency issues, but clearly something got out of sync.

2 Likes