[ISSUE] did not find companionSidebarContentContainerEl

267 views
Skip to first unread message

Akshay Singhal

unread,
May 28, 2018, 6:05:21 AM5/28/18
to InboxSDK
Getting the following error for sdk.Global.addSidebarContentPanel({...})

www.inboxsdk.com/build/platform-implementation.js:83 Uncaught (in promise) Error: did not find companionSidebarContentContainerEl
    at e.value (www.inboxsdk.com/build/platform-implementation.js:83)
    at e.value (www.inboxsdk.com/build/platform-implementation.js:83)
    at eval (www.inboxsdk.com/build/platform-implementation.js:108)
    at r (www.inboxsdk.com/build/platform-implementation.js:71)
    at Generator.eval [as _invoke] (www.inboxsdk.com/build/platform-implementation.js:71)
    at Generator.e.(/mail/u/1/anonymous function) [as next] (https://www.inboxsdk.com/build/platform-implementation.js:71:30745)
    at r (www.inboxsdk.com/build/platform-implementation.js:25)
    at eval (www.inboxsdk.com/build/platform-implementation.js:25)
    at new Promise (<anonymous>)
    at eval (www.inboxsdk.com/build/platform-implementation.js:25)
    at e (www.inboxsdk.com/build/platform-implementation.js:108)
    at chrome-extension://glgfedlmcocmoniofjkobmokihleepac/assets/src/scripts/gmail/injectCegaMainApp.js:959

It was working properly last on Friday, IIRC.

Gmail UI: New Material UI
Browser: Chrome Version 66.0.3359.181 (Official Build) (64-bit)

Aleem Mawani

unread,
May 29, 2018, 12:56:04 PM5/29/18
to akshay....@celigo.com, InboxSDK
We're seeing this error as well but at incredibly small rates. Can you consistently reproduce it? Are you using a delegated account?

--
You received this message because you are subscribed to the Google Groups "InboxSDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to inboxsdk+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/inboxsdk/ff674f58-0619-4474-b542-265fab44c308%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Akshay Singhal

unread,
May 29, 2018, 1:10:06 PM5/29/18
to InboxSDK
Hi Aleem,

Yes, we are able to reproduce the issue consistently. We are not using any delegated account.

Please let me know if I can provide you with more info. This is important to us, and would like to help as much as possible to get this resolved.



Akshay
--
Akshay Singhal | Dev, Productivity-Apps

E akshay....@celigo.com
W www.celigo.com
Follow Us   
--
Akshay Singhal | Dev, Productivity-Apps

E akshay....@celigo.com
W www.celigo.com
Follow Us   

Adam Saeid

unread,
May 30, 2018, 3:58:47 AM5/30/18
to InboxSDK
We're also seeing this error message consistently (i.e every time).

Not using delegated account. Using new Gmail UI and chrome Version 66.0.3359.181. 

At first it was only myself affected. After colleagues did CTRL + F5 they also saw the same issue, leading us to believe an update to gmail has broken something

ovidius...@luminos.software

unread,
May 30, 2018, 10:43:16 AM5/30/18
to InboxSDK
Hello. 
Same here... I have the same issue. The only way that i managed to make it work was to add a debugger and open the inspector.

Any new info on how to fix this?

ovidius...@luminos.software

unread,
May 30, 2018, 10:54:38 AM5/30/18
to InboxSDK
Another way to make it work was something like this...

let globalSidebarContainer = document.createElement('div'); 
globalSidebarContainer.setAttribute('id', 'dl-global-sidebar');

let addSidebarPromise = Promise.resolve(sdk.Global.addSidebarContentPanel({
    title: 'My Title',
    iconUrl: chrome.extension.getURL('images/del-checked-checkbox.png'),
    iconClass: 'dl-toolbar-icon',
    el: globalSidebarContainer,
    appName: 'My App Name'
}));

addSidebarPromise.then(() => {
    setTimeout(() => {
        renderDom(whatToRender(), globalSidebarContainer);
    }, 2000);
}); 

Akshay Singhal

unread,
May 30, 2018, 11:41:35 AM5/30/18
to InboxSDK
Thanks for posting your workaround. I have a question re the argument to Promise.resolve. Wouldn’t that argument rvaluation itself throw the above error.

Zanfir Ovidius

unread,
May 30, 2018, 5:17:34 PM5/30/18
to InboxSDK
Hello,

No, even if I use this without the Promise.resolve i will get that error. The reason why I am using the Promise.resolve is that I need to add some sort of a badge over the icon that will be added for the sidebar which is injected with some delay... so i am using this approach just to be sure that the badge is added only after the sidebar and the icon for the sidebar are injected in the DOM.

Zanfir Ovidius

unread,
May 30, 2018, 5:18:35 PM5/30/18
to InboxSDK
As an extra info... I have build my chrome extension using inboxSDK but also React. 

st...@ioet.com

unread,
Jun 5, 2018, 1:54:14 PM6/5/18
to InboxSDK
I have the same problem, someone know how to resolve this problem?

Zanfir Ovidius

unread,
Jun 6, 2018, 10:34:30 AM6/6/18
to InboxSDK
When can we see some fix regarding this issue? 

Zanfir Ovidius

unread,
Jun 11, 2018, 8:38:56 AM6/11/18
to InboxSDK
So, I was tinkering a little bit to see how can I fix this issue for me (since the prev workaround was not working as expected) and I realised that the problems comes from the fact that div .brC-brG' was not yet rendered in the DOM (from what I saw this is the container for the Global sidebar). So what i did was to create a function that will check every xx seconds if the container exists. I will put the code that i used:

_checkDOMChange() {
   
// check for any new element being inserted here,
   
// or a particular node being modified


    let sidebar
= document.querySelector('.brC-brG');
   
if (sidebar) {

        let globalSidebarContainer
= document.createElement('div');

        globalSidebarContainer
.setAttribute('id', 'my-sidebar-container');
        document
.addEventListener(
           
'DOMContentLoaded',
            sdk
.Global.addSidebarContentPanel({
                title
: 'Delegate',
                iconUrl
: chrome.extension.getURL('icon.png'),
                iconClass
: 'toolbar-icon',

                el
: globalSidebarContainer,
                appName
: 'My App Name'

           
}),
           
false
       
);
       
this.setState({
            sidebarAdded
: true
       
});
       
return;
   
}
   
// call the function again after 100 milliseconds
    setTimeout
(this._checkDOMChange, 100);
}


and in code I used something like this:

 if (sdk.User.isUsingGmailMaterialUI() && !this.state.sidebarAdded) {
       
this._checkDOMChange();    
}

I hope that this is useful for others.

Akshay Singhal

unread,
Jun 11, 2018, 2:44:41 PM6/11/18
to InboxSDK
Hi,
Thanks for sharing your workaround. Appreciate it. The only reason we haven't resorted to such a solution is that it defeats the purpose of employing InboxSDK in the first place. What if Google changes those classes overnight?

Akshay Singhal

unread,
Jun 11, 2018, 3:33:03 PM6/11/18
to InboxSDK
Based on Zanfir Ovidius's workaround, I tried to implement a brute/dumb try-until-success logic with a 2-second gap, and that seems to work as well. The added advantage with a brute/dump implementation is zero DOM dependency.

(function addSidebarContentPanel() {
try {
sdk.Global.addSidebarContentPanel({...})
.then(...)
.catch( function ( ex ) {
console.error( 'Failed to add sidebar content panel', ex );
setTimeout( addSidebarContentPanel, 2000 );
} );
}
catch ( ex ) {
console.error( 'Failed to add sidebar content panel', ex );
setTimeout( addSidebarContentPanel, 2000 );
}

Zanfir Ovidius

unread,
Jun 11, 2018, 3:54:08 PM6/11/18
to InboxSDK
This looks nice. Yes, i know that my solution was DOM dependent but I needed a fast solution that was working until a proper fix will be ready.

I am happy to know that I helped a little bit ;)

Cheers. 

Akshay Singhal

unread,
Jun 11, 2018, 4:00:22 PM6/11/18
to InboxSDK

Ian VanSchooten

unread,
Jul 23, 2018, 5:08:33 AM7/23/18
to InboxSDK
The sidebar is no longer opening for me if I refresh the page while viewing a thread (in the new gmail), and I get this error.  Is there a chance that we can get an update from the InboxSDK team?

Akshay Singhal

unread,
Jul 23, 2018, 5:20:31 AM7/23/18
to InboxSDK
Hi Ian,
FYI: InboxSDK team had written back to me earlier (~ 4-5 weeks back) that they aren't seeing this error repro consistently enough in their environment, and thus this is not a priority for them at the moment. Some of us have resorted to retrying (brutely and repeatedly if required) the invocation of the addSidebarContentPanel method, using a try-catch block.

Thanks,
Akshay

Pat Walls

unread,
Jun 5, 2019, 3:42:37 AM6/5/19
to InboxSDK
I am still experiencing this issue :( Any updates on a fix?
Reply all
Reply to author
Forward
0 new messages