I found a solution that is somehow complicated. I send a chrome runtime event after opening the window and open the side panel in the listener. It works. I think the error is because there can not be any await before sidePanel.open(), like this .