Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR TypeError: this.toasts[0] is undefined #1317

Closed
robacarp opened this issue Apr 18, 2022 · 2 comments
Closed

ERROR TypeError: this.toasts[0] is undefined #1317

robacarp opened this issue Apr 18, 2022 · 2 comments
Labels

Comments

@robacarp
Copy link

robacarp commented Apr 18, 2022

Describe The Bug:

Since 4.43.0, various modal dialogs do not correctly dismiss when clicking "OK". The "Cancel" button still works.

To Reproduce:

The behavior is intermittent. I hit the error several times while using the wizard-style configuration editor. Typically the network request would go through and get a 200 response, but I had to click cancel for the dialog to disappear.

I also hit the bug:

  • when uninstalling a plugin
  • when activating a plugin into child-bridge mode
  • and when the reboot screen is waiting on the server to reboot

All of these are inconsistent.

Here are the plugins I have installed:

  • homebridge-config-ui-x v4.43.0
  • homebridge-hubitat-makerapi v0.4.15 -- this plugin has been installed for some time
  • homebridge-orbit-irrigation v1.2.6 -- the error is still present without this plugin

Expected behavior:

Clicking OK should either dismiss the modal or present an error which helps me resolve bad input.

Logs:

The error in the console message shows this. I'm not sure it's going to be any help because the traces are pointing to compressed code. Perhaps you can make sense of it.

ERROR TypeError: this.toasts[0] is undefined
ERROR TypeError: this.toasts[0] is undefined
    _buildNotification http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    _preBuildNotification http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    warning http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    checkTimeout http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    0 http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    invokeTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    onInvokeTask http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    invokeTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    runTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    invokeTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    invoke http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    0 http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    setTimeout handler*d http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    scheduleTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    onScheduleTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    scheduleTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    scheduleTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    scheduleMacroTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    $ http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    c http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    n http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    checkIfServerUp http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    ngOnInit http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    __tryOrUnsub http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    next http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    _next http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    next http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    _next http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    next http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    _next http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    next http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    notifyNext http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    _next http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    next http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    we http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    invokeTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    onInvokeTask http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    invokeTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    runTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    invokeTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    N http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    I http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    F http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    t http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    scheduleTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    onScheduleTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    scheduleTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    scheduleTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    scheduleEventTask http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    u http://172.16.0.25:8080/polyfills.d9ad7e29a50a82c7.js:1
    handle http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    _trySubscribe http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    subscribe http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    h http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    _innerSub http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    _tryNext http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    _next http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    next http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    e http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    _trySubscribe http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    subscribe http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    call http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    subscribe http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    call http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    subscribe http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    call http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    subscribe http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    ngOnInit http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    Io http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    wo http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    Eo http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    Dl http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
    $b http://172.16.0.25:8080/main.c37c2541aaa97aa0.js:1
   main.c37c2541aaa97aa0.js:1:2188312

Screenshots:

Screen.Recording.2022-04-18.at.10.41.07.AM.mov

Environment:

  • Node.js Version: 16.14

  • NPM Version: 8.3.1

  • Homebridge Version: 1.4.0

  • Homebridge Config UI X Version: 4.43.0

  • Operating System: macOS

  • Process Supervisor: hb-service

  • Browser: Firefox 99.0

@robacarp robacarp added the bug label Apr 18, 2022
@oznu
Copy link
Member

oznu commented Apr 20, 2022

Thanks for reporting this.

It should be fixed in [email protected]

If you're able to test: https://github.com/oznu/homebridge-config-ui-x/wiki/How-To-Test-Upcoming-Changes

@oznu oznu closed this as completed in 9299267 Apr 20, 2022
@robacarp
Copy link
Author

robacarp commented Apr 20, 2022

@oznu thanks for your quick fix. I installed the test release and I believe that this does fix the issue, but it's difficult to guarantee without some exact steps to reproduce the problem -- I was never able to discern a sequence of events that would reliably reproduce. I'm glad the fix was as simple as updating the dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants