widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.87k stars 135 forks source link

Javascript error for solara version 1.35.1 and 1.36.0 #720

Open heaysa opened 2 months ago

heaysa commented 2 months ago

Beginning with solara 1.35.1 I encounter a javascript error when using solara run ... , including for this script pulled from the solara documentation

"""# Interactive sine wave

This example shows how to have two slider control a visualization.

"""

import numpy as np
import plotly.express as px

import solara

x = np.linspace(0, 2, 100)

title = "Interactive sine wave"
freq = solara.reactive(2.0)
phase = solara.reactive(0.1)

@solara.component
def Page():
    y = np.sin(x * freq.value + phase.value)

    solara.FloatSlider("Frequency", value=freq, min=0, max=10)
    solara.FloatSlider("Phase", value=phase, min=0, max=np.pi, step=0.1)

    fig = px.line(x=x, y=y)
    solara.FigurePlotly(fig)

This is running in a python (3.10.7) venv with requirement

numpy
plotly
solara==1.35.1
solara[assets]==1.35.1
pandas

Including assets does not solve the problem.

The error is:

[Open Browser Console for more detailed log - Double click to close this message] Failed to load model class 'HtmlModel' from module 'jupyter-vuetify' makeError@http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:168:17 onScriptError@http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:1738:36

The browser console output:

rootPath <empty string> localhost:8765:500:17
solara init solara-main undefined localhost:8765:638:13
Loading failed for the <script> with source “http://localhost:8765/static/nbextensions/jupyterlab-plotly/extension.js?5c137702cb258f8aaf20778be94aaf3b”. localhost:8765:1:1
Uncaught Error: Script error for "/static/nbextensions/jupyterlab-plotly/extension.js"
https://requirejs.org/docs/errors.html#scripterror
    makeError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:168
    onScriptError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:1738
require.js:168:17
Loading failed for the <script> with source “http://localhost:8765/static/nbextensions/jupyter-vuetify/nodeps.js”. localhost:8765:1:1
Falling back to https://cdn.jsdelivr.net/npm/ for jupyter-vuetify@^1.9.4 loader.js:67
Loading failed for the <script> with source “http://localhost:8765/static/nbextensions/jupyter-vuetify/nodeps.js”. localhost:8765:1:1
Error: Script error for "nbextensions/jupyter-vuetify/nodeps"
https://requirejs.org/docs/errors.html#scripterror
    makeError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:168
    onScriptError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:1738
manager-base.js:575
Falling back to https://cdn.jsdelivr.net/npm/ for jupyter-vuetify@^1.9.4 loader.js:67
Loading failed for the <script> with source “http://localhost:8765/static/nbextensions/jupyter-vuetify/nodeps.js”. localhost:8765:1:1
Error: Script error for "nbextensions/jupyter-vuetify/nodeps"
https://requirejs.org/docs/errors.html#scripterror
    makeError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:168
    onScriptError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:1738
manager-base.js:575
Falling back to https://cdn.jsdelivr.net/npm/ for jupyter-vuetify@^1.9.4 loader.js:67
Loading failed for the <script> with source “http://localhost:8765/static/nbextensions/jupyter-vuetify/nodeps.js”. localhost:8765:1:1
Error: Script error for "nbextensions/jupyter-vuetify/nodeps"
https://requirejs.org/docs/errors.html#scripterror
    makeError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:168
    onScriptError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:1738
manager-base.js:575
Falling back to https://cdn.jsdelivr.net/npm/ for jupyter-vuetify@^1.9.4 loader.js:67
Loading failed for the <script> with source “http://localhost:8765/static/nbextensions/jupyter-vuetify/nodeps.js”. localhost:8765:1:1
Error: Script error for "nbextensions/jupyter-vuetify/nodeps"
https://requirejs.org/docs/errors.html#scripterror
    makeError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:168
    onScriptError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:1738
manager-base.js:575
Loading failed for the <script> with source “http://localhost:8765/static/nbextensions/jupyter-vue/nodeps.js”. localhost:8765:1:1
Falling back to https://cdn.jsdelivr.net/npm/ for jupyter-vue@^1.11.1 loader.js:67
Loading failed for the <script> with source “http://localhost:8765/static/nbextensions/jupyter-vue/nodeps.js”. localhost:8765:1:1
Error: Script error for "nbextensions/jupyter-vue/nodeps"
https://requirejs.org/docs/errors.html#scripterror
    makeError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:168
    onScriptError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:1738
manager-base.js:575
Falling back to https://cdn.jsdelivr.net/npm/ for jupyter-vuetify@^1.9.4 loader.js:67
Loading failed for the <script> with source “http://localhost:8765/static/nbextensions/jupyter-vuetify/nodeps.js”. localhost:8765:1:1
Error: Script error for "nbextensions/jupyter-vuetify/nodeps"
https://requirejs.org/docs/errors.html#scripterror
    makeError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:168
    onScriptError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:1738
manager-base.js:575
Falling back to https://cdn.jsdelivr.net/npm/ for jupyter-vuetify@^1.8.5 loader.js:67
Loading failed for the <script> with source “http://localhost:8765/static/nbextensions/jupyter-vuetify/nodeps.js”. localhost:8765:1:1
Error: Script error for "nbextensions/jupyter-vuetify/nodeps"
https://requirejs.org/docs/errors.html#scripterror
    makeError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:168
    onScriptError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:1738
manager-base.js:575
Falling back to https://cdn.jsdelivr.net/npm/ for jupyter-vue@^1.11.1 loader.js:67
Loading failed for the <script> with source “http://localhost:8765/static/nbextensions/jupyter-vue/nodeps.js”. localhost:8765:1:1
Error: Script error for "nbextensions/jupyter-vue/nodeps"
https://requirejs.org/docs/errors.html#scripterror
    makeError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:168
    onScriptError http://localhost:8765/_solara/cdn/requirejs@2.3.6/require.js:1738
manager-base.
maartenbreddels commented 1 month ago

Hi,

thanks for the report. Is this on windows?

heaysa commented 1 month ago

This is on Ubuntu 22 building a venv with the ubuntu repo version of python.

If it helps, I get the same error using python installed via guix, and whether the solara server is loaded in firefox or google chrome.

havok2063 commented 1 month ago

I am also seeing this error with the latest solara 1.37, running in a docker container with a miniconda3 image, running python 3.10. I'm running solara with the --production flag.

maartenbreddels commented 1 month ago

Hi,

i was expecting this to be resolved (see https://github.com/widgetti/solara/issues/723#issuecomment-2315312598 ) But that was windows only. I'll contact you privately @havok2063 to see if we can debug this together.