TypeError: Cannot set properties of undefined (setting '_headers')

435 views
Skip to first unread message

Allan Tang

unread,
Sep 27, 2022, 2:47:25 PM9/27/22
to InboxSDK
Hi InboxSDK team,

We are trying to upgrade our Chrome extension from manifest v2 to manifest v3 with the latest beta version of inboxSDK v3 (0.2.16).

We are getting the following error even after we upgrade:

inboxsdk.js:41293 Error logged: TypeError: Cannot set properties of undefined (setting '_headers')
    at MessagePort.<anonymous> (inboxsdk.js:12447:35)
    at inboxsdk.js:86988:30
    at Function.value (inboxsdk.js:87348:38)
    at MessagePort.<anonymous> (inboxsdk.js:86987:29)

Original error stack:
TypeError: Cannot set properties of undefined (setting '_headers')
    at MessagePort.<anonymous> (chrome-extension://kkhonmaodpabkniacjmpjfalodbipijp/inboxsdk.js:12447:35)
    at chrome-extension://kkhonmaodpabkniacjmpjfalodbipijp/inboxsdk.js:86988:30
    at Function.value (chrome-extension://kkhonmaodpabkniacjmpjfalodbipijp/inboxsdk.js:87348:38)
    at MessagePort.<anonymous> (chrome-extension://kkhonmaodpabkniacjmpjfalodbipijp/inboxsdk.js:86987:29)

Error logged from:
    at n (chrome-extension://kkhonmaodpabkniacjmpjfalodbipijp/inboxsdk.js:41276:41)
    at l (chrome-extension://kkhonmaodpabkniacjmpjfalodbipijp/inboxsdk.js:86968:31)
    at Function.value (chrome-extension://kkhonmaodpabkniacjmpjfalodbipijp/inboxsdk.js:87357:29)
    at Function.value (chrome-extension://kkhonmaodpabkniacjmpjfalodbipijp/inboxsdk.js:87350:40)
    at MessagePort.<anonymous> (chrome-extension://kkhonmaodpabkniacjmpjfalodbipijp/inboxsdk.js:86987:29)

Error details: Uncaught error in event listener

Extension App Ids: [
  {
    "appId": <redacted>
  }
]
Sent by App: false
Session Id: 1664302332483-0.13525754099548326
Extension Id: null
InboxSDK Loader Version: 0.7.25-1663103180172-3130c92ab1e82bfc
InboxSDK Implementation Version: 0.7.25-1663103180172-3130c92ab1e82bfc
Is Using Sync API: true

If it helps, we untar'ed and extracted the files `pageWorld.js` and `inboxsdk.js` from npm into our extension folder along with other scripts for our extension. We then upload the extension folder to the chrome store.

A snippet of our v3 manifest looks like
"content_scripts": [
  {
    "matches": [
    ],
    "js": [
      "pageWorld.js", "inboxsdk.js", <other scripts etc.>
    ]
  }
]

and we invoke `InboxSDK.load` within our other scripts.

We had a working v3 solution around July 13 with version 0.2.8. Reading through other posts, looks like a couple of gmail updates were rolled out that broke compatibility.

Any help or communication regarding the matter would be greatly appreciated. We have many users using our extension and would need time to figure out the state of our extension before the end of year 

T

unread,
Dec 13, 2022, 6:37:57 PM12/13/22
to InboxSDK
I am also experiencing this issue. Did you find a solution?

Allan Tang

unread,
Dec 15, 2022, 6:00:29 PM12/15/22
to InboxSDK
Unfortunately, not yet. Based on the new chrome manifest v3 sunset timeline, we're still figuring out priorities on our end.

Would love to be kept in the loop if the problem gets rectified.

Abby

unread,
Dec 16, 2022, 4:06:20 AM12/16/22
to InboxSDK
So this error is coming from "pageWorld.js", you should remove it from "content_scripts" because it's not needed there

T

unread,
Dec 16, 2022, 6:13:26 PM12/16/22
to InboxSDK
Thanks for the suggestion Abby but unfortunately, without including pageWorld.js, the Inbox SDK won't load at all for manifest V3 extensions. 

In order to make InboxSDK load, I needed to include pageWorld.js in the build, and copy/paste from the background script.

Denying load of chrome-extension://<extension-id>/pageWorld.js. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.

Another user has reported this issue on Github here: https://github.com/InboxSDK/InboxSDK/issues/796

The workaround to get it to function is to include pageWorld.js so that Inbox SDK works. Without it, Inbox SDK will not work.

After including pageWorld.js and the related background script (copy/paste from here: https://github.com/InboxSDK/InboxSDK/blob/main/packages/core/background.js) as described in that thread, Inbox SDK will work. Without it, it will not. 

Including pageWorld.js causes the issue described in this original thread (headers error).

It would be amazing if Inbox SDK could work without needing to include pageWorld.js but it looks to be required for manifest V3.

Abby

unread,
Dec 19, 2022, 4:18:06 AM12/19/22
to InboxSDK
Actually pageWorld.js is the script where the implementation resides (AFAIK). Just make sure it's copied into you final build (via webpack config for example as mentioned in above thread) folder and it should just work.
Reply all
Reply to author
Forward
0 new messages