InboxSDK will not load

552 views
Skip to first unread message

dmich...@persista.com

unread,
Apr 12, 2016, 8:30:18 PM4/12/16
to InboxSDK
My team is using InboxSDK in a chrome extension. When ever a user opens the extension while on a gmail page, we InboxSDK with 
    InboxSDK.load(inboxSdkAppVersion, inboxSdkAppId).then(...);

The issue is that randomly but often the sdk doesn't load at all. We may never receive anything from the load promise. There is no error, or output of any kind. It appears to just hang. 
Converting the loading call to 
    const sdk = await InboxSDK.load(inboxSdkAppVersion, inboxSdkAppId);    
results in fewer failed loads, but every now and again it will hang. Is there any reason why the load would fail?

Chris Cowan

unread,
Apr 12, 2016, 8:40:28 PM4/12/16
to InboxSDK
Do you see any errors printed in the browser's console? We usually log a lot to the console when it fails to load.

The inboxsdk load depends on a request for https://www.inboxsdk.com/build/platform-implementation.js succeeding. If that request fails, then inboxsdk will fail to load.

It's also possible for the inboxsdk to successfully load the platform-implementation script, but then fail to parse Gmail's DOM. The inboxsdk waits up to a few minutes for specific elements to appear on the page before continuing initialization. It will print some error messages in the console (and log those errors to us) if this initialization times out.

dmich...@persista.com

unread,
Apr 12, 2016, 9:19:33 PM4/12/16
to InboxSDK
I doesn't print anything to the console and in the network tab the request for platform-implementation returns with the code. Given that the loading started to fail less after we added await, so I am willing to side with the idea that it's tripping over the DOM loading, but still without errors in the console I can't say for sure.

Sacha

unread,
Apr 25, 2016, 5:22:52 AM4/25/16
to InboxSDK
Yes, I have a similar behavior ; sometimes, it can load 100 times in a row without an issue, sometimes for like 5', trying to refresh the page/reload the extension/uninstall and reinstall it, it just doesn't react at all and there's no way to verify whether or not the sdk is actually doing anything. And then, without doing anything, it seems to unblock and work again as expected, until it stops reacting again...

@dmich...@persista.com: Could you please share the complete calling function to initialize the InboxSDK with the await ? I tried but had errors of "unexpected identifier" of the InboxSDK.

Chris Cowan

unread,
Apr 25, 2016, 1:59:13 PM4/25/16
to InboxSDK
Do you see a network request made the inboxsdk? If you open the console and wait five minutes, do any console errors appear?

Using await won't make the InboxSDK more dependable to load, but it is a useful tool when writing async-heavy javascript. Async/await can be used if you transpile your code with Babel (which you're probably already using if you're using React) with the stage-3 babel preset.
Reply all
Reply to author
Forward
0 new messages