home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
3.73k stars 2.53k forks source link

Error while loading page lovelace. on 2024.5.0 #20697

Closed jaymunro closed 1 week ago

jaymunro commented 2 weeks ago

EDIT: If you have this issue on iOS, just don't add more "Me too" type comments but use the thumbs up on the relevant comment perhaps this top comment, or use the "Subscribe" button. If you have something new to add, then please do comment.

Checklist

Describe the issue you are experiencing

Issue exists on:

Issue does not exist on

When loading the app the login page is empty of text but has graphics and input is possible. See screenshot below. 327292578-af4dd659-e9be-4e78-b730-9b6cb708b53a

After login UI does not show and only displays an error Error while loading page lovelace. as per the screenshot below: 327293641-0bc9c10c-6353-4a5c-94d0-c9c8ea1b982d

This occurs on all menu items on the left including "Settings".

Describe the behavior you expected

To use the UI as per normal

Steps to reproduce the issue

  1. Upgrade to 2024.5.0
  2. Try to login and use HA on an old iOS version or any Chrome browser on iOS
  3. If the issue does not present itself on a new iOS and Chrome then chose the Chrome option "Request desktop site"
  4. The UI will fail to display dashboards, Energy, Logbook, History, Settings (but will display Developer tools and addons such as HACS, ESPHome, Studio code server, etc).

What version of Home Assistant Core has the issue?

2024.5.0

What was the last working version of Home Assistant Core?

2024.4.4

In which browser are you experiencing the issue with?

Google Chome 124.0.6367.88 and Home Assistant Companion 2023.12.1

Which operating system are you using to run this browser?

iOS 17.1 & iOS 12.5.7

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

gerrypc72 commented 2 weeks ago

Same problem, same condition. Sensors work fine, from the other UI I can have all the informations provided from the companion app

shovelheadman commented 2 weeks ago

Same problem on older iPad used for dashboard view only.

jaymunro commented 2 weeks ago

Same problem on older iPad used for dashboard view only.

That's pretty much the use case of mine, but it is also used for control by family members for lighting, heating and radio. It's completely offline now and that's an issue in the family.

I can't revert to the backup without losing all the sensor data since the upgrade so not keen to do that either.

hutti666 commented 2 weeks ago

Same problem here

oldiebastler commented 2 weeks ago

Ich habe das gleiche Problem mit meinem alten iPad.

Pr0mises commented 2 weeks ago

Same problem here, also IOS 12.5.7 Companion 2023.12.1, Google Chrome Version 90.0.4430.216 and Safari

HellJohny commented 2 weeks ago

iPad mini 2. Safari browser. After update same problem.

Olsenoli commented 2 weeks ago

I habe the same Problem. Is there already a possible solution to the problem?

deltazerorsan commented 2 weeks ago

I just went back to 2024.4 to recover my dashboards on old iPads.

Now we have to wait for a solution...

jaymunro commented 2 weeks ago

Does this also affect anyone else loading HA in Chrome on a recent iPad or iPhone? A dev in Discord is saying it is not affecting him, however it is broken in Chrome for me on an iPad with current iOS too.

gerrypc72 commented 2 weeks ago

I have a newer iPad with iPadOS 17.4.1and it works fine on that

jaymunro commented 2 weeks ago

On the old iPad, rather than using the private browser I cleared all cache and browser history and now it results in "Safari cannot open the page because it could not connect to the server." This suggests to me that this is related to the Strict Connections feature that got pulled.

jaymunro commented 2 weeks ago

I have a newer iPad with iPadOS 17.4.1and it works fine on that

Are you saying Chrome works fine? Or did you use Safari / Companion app?

jaymunro commented 2 weeks ago

Ok, this may be a big clue and help reproduce the issue. In Chrome on my recent iPad, I chose the option to "Request Mobile Site" and the issue goes away. I then "Request desktop site" and the issue returns. Same on the iPhone 12. That seems to be the difference.

Can someone else reproduce this?

Joshbloam commented 2 weeks ago

Same issue here. iPad air first gen IOS 12.5.7. Companion app 2023.12.1. Restored my HA instance back to 2024.4.0 to recover.

patkino commented 2 weeks ago

Same.issue here. Chinese android 8.1 control panel. Companion doesn't work, web interface via Chrome works fine

lukonin commented 2 weeks ago

Same issue with iPad Mini 2. Reverted back to 2024.4.0.

gerrypc72 commented 2 weeks ago

Ok, this may be a big clue and help reproduce the issue. In Chrome on my recent iPad, I chose the option to "Request Mobile Site" and the issue goes away. I then "Request desktop site" and the issue returns. Same on the iPhone 12. That seems to be the difference.

Can someone else reproduce this?

On older iPad Air (2014) IOS 12.5.7 It doesn't work via the Companion App or the Safari browser, not even by requesting the desktop site. Both the Companion App and the Safari browser work perfectly on the iPad Pro (2018) IOS 17.4.1. I don't have Chrome

jaymunro commented 2 weeks ago

On older iPad Air (2014) IOS 12.5.7 It doesn't work via the Companion App or the Safari browser, not even by requesting the desktop site. Both the Companion App and the Safari browser work perfectly on the iPad Pro (2018) IOS 17.4.1. I don't have Chrome

Yes, same for me on the newer iPad. Companion and Safari have no issues. It is just Chrome desktop version on the newer iPad and everything on the older iPad.

I'm hoping others can confirm the behaviour of Chrome between desktop and mobile versions on the newer iPads. This may help the devs replicate it and fix it faster.

pvmil commented 2 weeks ago

I have the same issiue, iPad Air running IOS 12.5.7 The installed chrome and safari browsers have the login page issue, after logging in they do show the menubar. Opening dashboards, settings etc does not show anything but 'Error while loading page dashboard' The companion app shows the setting cog, which works, but I do not get any other information after that, no menu bar, nothing.

jaymunro commented 2 weeks ago

@frenck @balloob are you aware of this rather major regression?

nemocrk commented 2 weeks ago

Is there any way to enable diagnostic on http (or maybe aiohttp), it seems that the connection is closed before the whole content is transferred. i've already enabled the debug level on homeassistant.components.http (and tried with aiohttp.server) but nothing has been logged

piitaya commented 2 weeks ago

Can someone can provide browser logs? 🙂

pvmil commented 2 weeks ago

Can someone can provide browser logs? 🙂

I made a log using the chrome browser by using the chrome://inspect url.

The output I got (after visiting several pages): `http://192.168.1.11:8123/config/dashboard

INFO %cBROWSER_MOD 2.3.0 IS INSTALLED %cBrowserID: XYZXYZREPLACEBYMEXYZ color: green; font-weight: bold

ERROR Error loading page dashboard TypeError: i is not a function. (In 'i()', 'i' is an instance of Object)`

ERROR Error loading page logbook TypeError: r is not a function. (In 'r()', 'r' is an instance of Object)`

ERROR Error loading page history TypeError: r is not a function. (In 'r()', 'r' is an instance of Object)`

ERROR Error loading page energy TypeError: r is not a function. (In 'r()', 'r' is an instance of Object)`

ERROR Error loading page calendar TypeError: r is not a function. (In 'r()', 'r' is an instance of Object)`

ERROR Error loading page media-browser TypeError: r is not a function. (In 'r()', 'r' is an instance of Object)`

ERROR Error loading page general TypeError: i is not a function. (In 'i()', 'i' is an instance of Object)`

This shows my use of browser_mod , (HACS) are others using this?

In addition errors (hopefully the root-cause) are logged

edit: i tested some more pages and provided additional logging. The only pages which give content are the developer tools and HACS

Does this provide enough information? Can I create additional logging? (safari logging is more complicated since it requires a laptop connection)

silamon commented 2 weeks ago

Normally these errors should also be logged to the system logging. Can they found there, possibly with a full stacktrace?

pvmil commented 2 weeks ago

Normally these errors should also be logged to the system logging. Can they found there, possibly with a full stacktrace?

I do not see any related error in the logging in HA (checked 'Home assistant Core', 'supervisor', 'Host').

silamon commented 2 weeks ago

Apparently it's possible to open the browser console from chrome://inspect by using "inspect". We'll need the stack trace of any of those: ERROR Error loading page dashboard TypeError: i is not a function. (In 'i()', 'i' is an instance of Object)`.

samfaitmalomolet commented 2 weeks ago

Hello, I have this data from inspect on my ipad air 20240503_194957 I don't know how to get the stack trave

jaymunro commented 2 weeks ago

From https://developer.chrome.com/blog/debugging-chrome-on-ios/

On your iOS device you need:

iOS 16.4 or greater. Chrome 115 or greater. On your Mac you need:

The Safari Develop menu enabled. Enable this from Safari application settings, Advanced Settings tab. On your iOS device launch the Chrome app and navigate to Settings. In Content Settings, enable Web Inspector. Relaunch Chrome for iOS after changing this setting.

Debugging your site

With the setting enabled, you can debug any page running in Chrome for iOS by following these steps.

Connect your iOS device to a Mac with a cable. In Chrome for iOS, navigate to the website which you'd like to inspect. On your Mac, launch Safari. From the Develop menu, hover over the name of your connected device and select the url of the website which you would like to inspect. The displayed Web Inspector window will allow debugging of the current web view.

I'll try this later today but if someone can beat me to it, great. I need to go out now and mow the lawns to make up for my mistake in disabling our main control panel into HA.

jaymunro commented 2 weeks ago

Ok, I was able to remotely connect to Safari with Web Inspector on my old iPad.

For the login screen where all text is missing, this is shown in the console:

[Error] Unhandled Promise Rejection: TypeError: i is not a function. (In 'i()', 'i' is an instance of Object)
    (anonymous function) (848.RLtFmELmVmg.js:1:621)
    (anonymous function) (848.RLtFmELmVmg.js:1:5359)
    d (authorize.bgGP9HuyRNc.js:2:450428)
    d
    promiseReactionJob
[Error] Unhandled Promise Rejection: TypeError: a is not a function. (In 'a()', 'a' is an instance of Object)
    (anonymous function) (4115.gLuPLXiiJG8.js:1:190)
    promiseReactionJob

After logging in, this is shown in the console when viewing my main dashboard:

[Error] Unhandled Promise Rejection: SyntaxError: Unexpected token '.'
    (anonymous function)
    rejectPromise
    promiseReactionJob
[Error] Unhandled Promise Rejection: TypeError: 'text/html' is not a valid JavaScript MIME type.
    (anonymous function)
    rejectPromise
    promiseReactionJob
[Error] Unhandled Promise Rejection: TypeError: a is not a function. (In 'a()', 'a' is an instance of Object)
    (anonymous function) (70635.Zu5pSVmnIHw.js:1:124513)
    (anonymous function) (70635.Zu5pSVmnIHw.js:1:141396)
    l (app.9QvPhNMccVE.js:2:337446)
    l
    promiseReactionJob
[Error] Error loading page – "lovelace"
       TypeError: r is not a function. (In 'r()', 'r' is an instance of Object)
              (anonymous function) — show-edit-view-dialog.ts:43
              (anonymous function) — ha-panel-lovelace.ts:54
              l — bootstrap:19
              l
              promiseReactionJob
    (anonymous function) (app.9QvPhNMccVE.js:2:98247)
    promiseReactionJob
[Error] Unhandled Promise Rejection: TypeError: i is not a function. (In 'i()', 'i' is an instance of Object)
    dispatchException (app.9QvPhNMccVE.js:2:274590)
    (anonymous function) (app.9QvPhNMccVE.js:2:271682)
    r (app.9QvPhNMccVE.js:2:256651)
    u (app.9QvPhNMccVE.js:2:256891)
    promiseReactionJob
        https://local.ha.munro.cc/frontend_es5/app.9QvPhNMccVE.js
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (bootstrap, line 0)

I noticed the links shown to the right of the errors are not copied so here is a screenshot of the console:

327916942-9b0e4a6c-b264-473d-a86e-97aa4eb9ce3e
jaymunro commented 2 weeks ago

@karwosts note there has also been one report from an Android user https://github.com/home-assistant/frontend/issues/20697#issuecomment-2092114465

dimkin-eu commented 2 weeks ago

Same here for HA 2024.5.1

reverted to 2024.4.4

jeremychan commented 2 weeks ago

It seems the problem lies in line 43 of show-edit-view-dialog.ts

image

which correspond to this line in the minified file 28316.Swg859rYwb0.js

image

in the debugger r here is an Object not a callable function. Thus causing error TypeError: r is not a function. (In 'r()', 'r' is an instance of Object)

image

mheiker commented 2 weeks ago

same to me

apeiron69 commented 1 week ago

I'm sorry to have opened a new post about this issue. Just to say I have the same issue on iPad with 13.5.7 iOS and 2024.5.1 HA core installed

silamon commented 1 week ago

If you have this issue on iOS, just don't add more comments but use the thumbs up on the relevant comment perhaps the top comment.

I can't debug or bisect the issue to see where it got introduced, but looking into the code doing the same as Jeremy brings me to #20543.

ljsquare commented 1 week ago

I've got the same problem met iPad mini 2 iOS 12.5.7 and HA 2024.5.1

piitaya commented 1 week ago

I reproduced the issue in my dev env. Here's the unminified error :

VM2530:5 Unhandled Promise Rejection: TypeError: _regeneratorRuntime is not a function. (In '_regeneratorRuntime()', '_regeneratorRuntime' is an instance of Object)dispatchException @ VM2530:5(anonymous function) @ VM2530:179asyncGeneratorStep @ VM2538:11_throw @ VM2538:33promiseReactionJob @ [native code]:1
VM2530:5 Unhandled Promise Rejection: TypeError: _regeneratorRuntime is not a function. (In '_regeneratorRuntime()', '_regeneratorRuntime' is an instance of Object)dispatchException @ VM2530:5(anonymous function) @ VM2530:179asyncGeneratorStep @ VM2538:11_throw @ VM2538:33promiseReactionJob @ [native code]:1
VM2922:5 Unhandled Promise Rejection: TypeError: _regeneratorRuntime is not a function. (In '_regeneratorRuntime()', '_regeneratorRuntime' is an instance of Object)

Thanks @silamon for the hint, it was because introduced with https://github.com/home-assistant/frontend/pull/20543. I pushed a PR to quickly fix the issue in the next patch release.

dward32 commented 1 week ago

Has this now been fixed.. I rolled back to previous version, what do I do now.. ? install 2024.5.1 again?

spacegaier commented 1 week ago

Has this now been fixed.. I rolled back to previous version, what do I do now.. ? install 2024.5.1 again?

It will be in the next patch release, so 2024.5.2

steverep commented 1 week ago

I reproduced the issue in my dev env. Here's the unminified error :

@piitaya what did you run it on?

piitaya commented 1 week ago

@steverep On iPad Pro 12.9 2018 on iOS 12.

steverep commented 1 week ago

@steverep On iPad Pro 12.9 2018 on iOS 12.

I cannot seem to repro yet and don't have older iOS hardware. If you run on v17 but force legacy build (by editing index.html), does the problem still occur?

steverep commented 1 week ago

I cannot seem to repro yet and don't have older iOS hardware. If you run on v17 but force legacy build (by editing index.html), does the problem still occur?

@piitaya nevermind - I can repro now and actual fix coming shortly.

dimkin-eu commented 1 week ago

did it managed to be included in 2024.5.2? cant see something here https://www.home-assistant.io/blog/2024/05/01/release-20245/#release-202452---may-6

Olsenoli commented 1 week ago

Hi everyone, after the patch 2024.5.2 it works with old ipad and old ios.

jaymunro commented 1 week ago

Confirmed with iOS 17.4.1

dimkin-eu commented 1 week ago

confirmed with iOS 12.5.7

PaulHam211 commented 1 week ago

Anyones app crashing when navigating to the profile page (bottom left, profile photo icon). Edit: waiting on the profile page does eventually let you to scroll. but its very slow. something is wrong

jaymunro commented 1 week ago

Anyones app crashing when navigating to the profile page (bottom left, profile photo icon). Edit: waiting on the profile page does eventually let you to scroll. but its very slow. something is wrong

All ok on both new and old iPads for me. Open a new issue if it still exists after the usual local suspects (cache, user, browser type, etc.) are confirmed not to be the issue.