MV3 Uncaught Reference Error

154 views
Skip to first unread message

Alex Eacott

unread,
Aug 3, 2022, 4:53:14 PM8/3/22
to InboxSDK
Hi,

I'm trying to upgrade our gmail integration that implements inboxSDK to MV3. I've used the boilerplate and ran npm install to get the current inboxsdk version. I merged the background.js file, and added pageWorld.js and all that is fine. However, now when I try to initialise inboxSDK, I keep hitting the error InboxSDK is not defined. Has anyone found this happening to them?

Chris Cowan

unread,
Aug 3, 2022, 5:56:36 PM8/3/22
to InboxSDK
When using the InboxSDK from NPM, you need to do `import * as InboxSDK from '@inboxsdk/core';` in any file that references the InboxSDK to make the InboxSDK variable available in that file. It's no longer a global variable as before.

Abby

unread,
Aug 4, 2022, 4:51:20 AM8/4/22
to InboxSDK
Hi Chris

Good to hear from you after long time, 
Is there any update on documentation planned? Also a bug tracker?
I still some typings are broken, don't know where to report :(

Cheers
Abby

Alex Eacott

unread,
Aug 4, 2022, 5:37:27 AM8/4/22
to InboxSDK
As our content-script is not a module, that method will not work. I am trying to use this bit of code to load InboxSDK but keep hitting InboxSDK.load is not a function:
(async () => {
const src = chrome.runtime.getURL('pageWorld.js');
const InboxSDK = await import(src);
InboxSDK.load(...).then((sdk) => console.log('loaded'));
})();

Alex Eacott

unread,
Aug 4, 2022, 5:53:16 AM8/4/22
to InboxSDK
the getURL line I have also tried with inboxsdk.js
Reply all
Reply to author
Forward
0 new messages