T.popup throws unhandled rejection error

I have a board button with a callback that calls a function resetMembership which calls a popup to confirm the user’s desire to change membership. When I run the following, all is ok:

const resetMembership = (t) => {
  t.popup({
    type: "confirm",
    title: 'Reset Board Membership',
    message: `Change`,
    confirmText: 'Proceed',
    onConfirm: (tx) => { 
      console.log("Confirmed"); 
      tx.closePopup(); 
    }
  });      
};

However, when I first try to get information from the board, I get an Unhandled Rejection Error

const resetMembership = (t) => {
  t.board('id', 'members', 'memberships')
    .then(board => {
      t.popup({
        type: "confirm",
        title: 'Reset Board Membership',
        message: `Change ${board.name}`,
        confirmText: 'Proceed',
        onConfirm: (tx) => { 
          console.log("Confirmed"); 
          tx.closePopup(); 
        }
      });    
    });
};

I have replaced the t.popup with a t.alert() and t.modal() without getting an error. I have also tried changing the popup type from confirm to a select list but still get the same error.

Does anyone have an idea on why this is happening?

Thanks!

Hi,

We had a very similar issue reported here. Could you please check and let me know whether it answers your question?

Thanks,
Valentyn

I don’t think it is the same situation.

In my case, t is defined and works if I use it to call a t.alert() or t.modal().

I eventually got it to work but I changed the way my Power-Up worked and am not sure what about the rewrite got it to work.

I will try to reproduce the problem and follow up with my solution.