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

solara.display doesn't work in flask #500

Closed
iisakkirotko opened this issue Feb 13, 2024 · 3 comments · Fixed by #622
Closed

solara.display doesn't work in flask #500

iisakkirotko opened this issue Feb 13, 2024 · 3 comments · Fixed by #622

Comments

@iisakkirotko
Copy link
Collaborator

If solara.display is used when running solara with flask we only get a javascript error:

Javascript Error: Cannot read properties of undefined (reading 'sanitize')

@egormkn
Copy link

egormkn commented Apr 27, 2024

I'm getting the same error when running Solara in production mode. In development mode everything is ok.
Output widget from ipywidgets also doesn't work in production mode.
Here is a stack trace:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'sanitize')
    at Object._ (webpack://widgetti/solara-widget-manager8/node_modules/@jupyterlab/rendermime/lib/renderers.js:393:31)
    at p.render (webpack://widgetti/solara-widget-manager8/node_modules/@jupyterlab/rendermime/lib/widgets.js:317:16)
    at p.renderModel (webpack://widgetti/solara-widget-manager8/node_modules/@jupyterlab/rendermime/lib/widgets.js:49:20)
    at p._setOutput (webpack://widgetti/solara-widget-manager8/node_modules/@jupyterlab/outputarea/lib/widget.js:414:27)
    at p.onModelChanged (webpack://widgetti/solara-widget-manager8/node_modules/@jupyterlab/outputarea/lib/widget.js:269:22)
    at u (webpack://widgetti/solara-widget-manager8/node_modules/@lumino/signaling/dist/index.es6.js:510:18)
    at e.emit (webpack://widgetti/solara-widget-manager8/node_modules/@lumino/signaling/dist/index.es6.js:465:17)
    at e.emit (webpack://widgetti/solara-widget-manager8/node_modules/@lumino/signaling/dist/index.es6.js:121:21)
    at u._onListChanged (webpack://widgetti/solara-widget-manager8/node_modules/@jupyterlab/outputarea/lib/model.js:231:23)
    at u (webpack://widgetti/solara-widget-manager8/node_modules/@lumino/signaling/dist/index.es6.js:510:18)

@iisakkirotko
Copy link
Collaborator Author

Thanks a lot @egormkn, your observation that this happens in production mode was very useful in finding the culprit!

iisakkirotko added a commit that referenced this issue May 1, 2024
…622)

These dependencies were aliased to an empty file to save on bundle size in 242d7e2, but turn out to be necessary for the rendering of some mimetypes. Because the aliasing takes place during the minification step, development mode still worked, but running in production mode would show a javascript error.

Fixes #500.
@iisakkirotko
Copy link
Collaborator Author

Should be fixed in solara==1.32.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants