python-eel / Eel

A little Python library for making simple Electron-like HTML/JS GUI apps
MIT License
6.3k stars 580 forks source link

Eel failed to show html pages after multiple refresh... #627

Open vikramsamak opened 1 year ago

vikramsamak commented 1 year ago

when I purposefully refreshed the index, it failed to reload it... is there any solution for this...

Note: I'm working on data science app in which I am showing some pie charts on frontend (by fetching data from python code) and that's why I was checking the performance of eel and the I found this bug.

zinixyt commented 1 year ago

Since i dont see any activity from the original developr im going to tell you the solution to the problem from my own experience. Eel has a function that detects if the browser is still active, if it detects the page has been closed/refreshed it stops the python script. So, reloading is not compatible with refreshes. This feature is intended.

1drg commented 1 year ago

Since i dont see any activity from the original developr im going to tell you the solution to the problem from my own experience. Eel has a function that detects if the browser is still active, if it detects the page has been closed/refreshed it stops the python script. So, reloading is not compatible with refreshes. This feature is intended.

I have been using eel for a while, and now and then I randomly get crashes when reloading a page or going to another page.

I generally get this on console:

WebSocket connection to 'ws://localhost:60220/eel?page=index.html' failed:

And the eel.js file points the error to this line:

eel._websocket = new WebSocket(websocket_addr);

All my html files have the eel.js tag btw.

Is there anything that could be done to solve this or make it more reliable?

vikramsamak commented 1 year ago

After seeing this many issues, I moved to another lib which also provides the facility of developing desktop based application by using HTML CSS JS.

1drg commented 1 year ago

After seeing this many issues, I moved to another lib which also provides the facility of developing desktop based application by using HTML CSS JS.

What did you ended up using?

vikramsamak commented 1 year ago

Now I am using flaskwebgui which is based on flask.. its working great for me...

dstricks commented 1 year ago

Hey @vikramsamak, I'm sorry you were having trouble! I hope that flaskwebgui works better for your use case. Do you by chance have a small example where the issue is easily reproducible so that I can take a look and see for myself? Or anyone else that is willing to create an example would also be appreciated.

kobayashi-deepinsight commented 1 year ago

@dstricks I also face similar issues during multiple refreshes or heavy page transitions. This tends to happen with transitions to large html pages, but it also reproduces with a very fast hit of the F5 key.

Launch ElloWorld and do a quick F5 refresh many times and you should be able to reproduce this.

kobayashi-deepinsight commented 1 year ago

This issue was already resolved in #453. I could have been happy if I made shutdown_delay large enough.