Unhandled rejection Error on t.popup

I am running into the following error when the user clicks on the Power-Up button and I try to display a popup:

The issue seems to arise because I am trying to call a popup after I get the id of the board in scope using t.board. The same thing was happening for this person (but I don’t think they ever raised the issue here so it never got investigated).

Here is the full relevant code. It is the callback inside of the “card-buttons” property of Trello.initialize:

...
callback: context => {
                t.board("id").then(({ id }) => {
                  if (checkIfCorrectBoard(id)) {
                    context.popup({
                      title: "My Custom Power-Up",
                      items: [
                        {
                          text: "Edit Power-Up Settings",
                          callback: function() {}
                        },
                        {
                          text: "Manage Subscription",
                          callback: function() {
                            return t.modal({
                              url: "./subscribe.html"
                            });
                          }
                        }
                      ]
                    });
                  } else {
                    context.popup({
                      title: 'My Custom Power-Up',
                      url: './auth.html',
                      height: 200
                    })
                  }
                })

Thank you in advance for any light you can shed on this! :slight_smile:

I can’t see your full code but is ‘t’ defined? Typically how I’ve seen card-button callbacks is that they take a ‘t’, and use that to call the client library. It seems like you are trying to use the client library from two sources, a ‘t’ and a ‘context’. Perhaps your issue lies there?

Also, your console shows the stack trace error with something in your client.js:63:29? I can’t see your code but perhaps that line is related somehow?