widgetti / solara

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

Opening localhost shows a blank page #490

Open russ-sk opened 7 months ago

russ-sk commented 7 months ago

I have only started using solara for experimenting purpose and I have created a very basic app and named it main.py. Hoever when I do a solara run main.py it redirects me to my localhost site but unfortunately the page remains blank.

However when I'm running the same code in my jupyter notebook the app works perfectly fine! What am I missing here ?

iisakkirotko commented 7 months ago

Hi @russ-sk!

Have you checked if the javascript developer tools show any errors? If not, could you share your code so I can take a look?

Helleeni commented 4 weeks ago

Hi, I'm trying to upgrade from solara 1.22.0 but with no success. The environment with 1.22.0 keeps working OK, but I can't make the new environment work.

I did a clean install in a new conda environment (windows 10, python 3.12 solara 1.37.1) and try to run the eample from here: https://solara.dev/documentation/getting_started "First Script".

solara run sol.py

The server gets started but only Solara logo is rendered on the tab with blank page (EDGE or Chrome). Browser console gives bunch of errors: "Failed to load resource: the server responded with a status fonts.ccs:1 of 404 (Not Found)" etc. etc.

When installed Jupyter Lab the example runs OK in the Jupyter Lab, but not from the command line. Any idea what I'm doing wrong?

I've also discussed in this in Discord with other user with same type of issue: https://discord.com/channels/1106593685241614489/1272769680641359893/1272769866545369138

... and opened a discussion item here: https://github.com/widgetti/solara/discussions/736#discussion-7059681 (sorry for multiple entries)

Edit: Tried exact the same thing on MacOS Sonoma 14.1.1 and Chrome Browser - works as expected. So my problem seems to be related to my Windows environment. But still appreciate if anyone has any advice on what might be the problem in Windows.

Edit 19th Aug 2024: Apparently the app tries to load a files from: "/_solara/cdn/font etc. etc." but can't find any of them. I can't figure out where in my computer local server root directory is so can't check if they are there.

maartenbreddels commented 4 weeks ago

Hi,

Apparently the app tries to load a files from: "/_solara/cdn/font etc. etc." but can't find any of them

Ok, that is a good hint. Did you try with and without solara-assets? Also, can you pinpoint which versions works and which one broke? e.g. do a rough binary search between 1.22.0 and 1.37.1?

Helleeni commented 4 weeks ago

Hi, thanks for noticing this. Yes I tried first with solara-assets and when that did not work I tried without. I will now work my way through versions starting from 1.22.0 up and see if I can make any of them work. Tried 1.30.0 and 1.23.0 - seems that I can't make any installation above 1.22.0 towork with conda or pip. (also created a new conda environment for 1.22.0 and that version still works).

This is not a 'Solara' issue as such (as demonstrably works on my personal Mac OK), but puts me in a difficult position as I've provided a solara application available in the corporate intranet and now can't find a way to upgrade.

1.23.0 gives following errors in the console:

    Failed to load resource: the server responded with a status of 500 (Internal Server Error)

mermaid.js:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error) (index):354 Uncaught ReferenceError: solara is not defined at (index):354:9 main-vuetify.js:1 Uncaught ReferenceError: Vue is not defined at main-vuetify.js:1:1 (index):367 Uncaught ReferenceError: solara is not defined at (index):367:9 (index):390 Uncaught TypeError: Cannot set properties of undefined (setting 'browser_platform') at (index):390:40

Then tried creating a new virtual environment with python venv. The same result with the same error codes as with conda installation (1.37.1). The first line of the errors below refers to: http://localhost:8765/_solara/cdn/@widgetti/solara-vuetify-app@10.0.3/dist/solara-vuetify-app8.js

  Failed to load resource: the server responded with a status of 404 (Not Found)

solara-vuetify-app8.js:1 Failed to load resource: the server responded with a status of 404 (Not Found) fonts.css:1 Failed to load resource: the server responded with a status of 404 (Not Found) (index):502 Uncaught ReferenceError: solara is not defined at (index):502:9 (index):1070 Uncaught ReferenceError: solara is not defined at (index):1070:9 (index):1076 Uncaught TypeError: Cannot set properties of undefined (setting 'browser_platform') at (index):1076:4 fonts.css:1 Failed to load resource: the server responded with a status of 404 (Not Found) main8.css:1 Failed to load resource: the server responded with a status of 404 (Not Found)