raspiblitz / raspiblitz-web

A mobile-first responsive Web UI for the RaspiBlitz
MIT License
58 stars 21 forks source link

Error when running on webui outside of a RaspiBlitz #735

Open fusion44 opened 1 month ago

fusion44 commented 1 month ago

The webui crashes during loading initial data with the following error:

An error occurred 😓

TypeError: t.filter is not a function

Please report this error to https://github.com/cstenglein/raspiblitz-web/issues

Stack trace:

U_@http://192.168.8.242/assets/index-CmFa5q9f.js:97:6553 hr@http://192.168.8.242/assets/index-CmFa5q9f.js:97:7767 cr@http://192.168.8.242/assets/index-CmFa5q9f.js:68:30651 Suspense xv@http://192.168.8.242/assets/index-CmFa5q9f.js:59:3932 Bv@http://192.168.8.242/assets/index-CmFa5q9f.js:59:7631 nk@http://192.168.8.242/assets/index-CmFa5q9f.js:97:13280 B1@http://192.168.8.242/assets/index-CmFa5q9f.js:68:29605 z1@http://192.168.8.242/assets/index-CmFa5q9f.js:68:27817 Pv@http://192.168.8.242/assets/index-CmFa5q9f.js:59:7093 Fv@http://192.168.8.242/assets/index-CmFa5q9f.js:68:924 rk@http://192.168.8.242/assets/index-CmFa5q9f.js:97:15031 o@http://192.168.8.242/assets/index-CmFa5q9f.js:68:27001

Here's the log output from the backend:

Jun 22 16:05:27 tbnix blitz-api[106540]: 2024-06-22 16:05:27 | ℹ️ | logging.py:90 | 192.168.8.126:0 - "GET /api/setup/status HTTP/1.0" 404 Jun 22 16:05:27 tbnix blitz-api[106540]: 2024-06-22 16:05:27 | ℹ️ | logging.py:90 | 192.168.8.126:0 - "GET /api/sse/subscribe HTTP/1.0" 200 Jun 22 16:05:29 tbnix blitz-api[106540]: 2024-06-22 16:05:29 | ℹ️ | logging.py:90 | 192.168.8.126:0 - "GET /api/lightning/list-all-tx?reversed=true HTTP/1.0" 200 Jun 22 16:05:29 tbnix blitz-api[106540]: 2024-06-22 16:05:29 | ℹ️ | logging.py:90 | 192.168.8.126:0 - "GET /api/lightning/list-all-tx?reversed=true HTTP/1.0" 200 Jun 22 16:05:29 tbnix blitz-api[106540]: 2024-06-22 16:05:29 | ❌ | main.py:288 | Error while fetching warmup_data for installed_app_status: 501: Not available in native python mode.

I suspect that the webui always expects some data for the the installed app status, which is not necessarily true when running on another platform.

escapedcat commented 1 month ago

Just curious. What's the context of "outside" and "another platform"? What are you trying to do? I think I can't follow :P

fusion44 commented 1 month ago

Fair enough :)

The API was written in a way that it can run on any system (not just RaspiBlitz). There are currently two platforms: raspiblitz and native_python. The platform native_python does not support any app installation as it is a somewhat generic implementation.

I'm currently working on nixifying RaspiBlitz and don't have any app support in it yet, which will arrive at some point, but makes testing harder for me at the moment.

A long term plan to make the app handling more dynamic in the webui would be nice. edit This also will require changes to the API to properly list all available apps. I don't think the API handles this well yet.

cstenglein commented 3 weeks ago

Most likely you send the installed_app_data but with some null values or something else, which the filter function doesn't expect.

Is there a simple setup to reproduce this?

cstenglein commented 16 hours ago

@fusion44 so if I guess correctly:

There are some platforms where no apps are available? Should I not show the App page there then?

fusion44 commented 14 hours ago

Correct, if you receive a 501 from the api you can assume that app support is not available. This would only a stopgap solution. I want to rework the app api completely. Currently it is not very sustainable.

cstenglein commented 7 hours ago

Is that the only feature which won't be available or will there be other things as well?