vocably / pontis

Painless Chrome extension authentication via AWS Amplify websites
MIT License
7 stars 0 forks source link

Uncaught TypeError: Error in invocation of storage.get #4

Closed hunainm closed 1 year ago

hunainm commented 1 year ago

After following the documentation and adding the storage in chrome extension, the extension fails to load and throws the following error in console

Uncaught TypeError: Error in invocation of storage.get(optional [string|array|object] keys, function callback): No matching signature. at f (main.js:2:298842) at e.value (main.js:2:301090) at e.configure (main.js:2:1372506) at Module. (main.js:2:1412793) at i (main.js:2:361) at main.js:2:2118 at main.js:2:2129

sneas commented 1 year ago

Hi Hunain, I've never seen such an error before.

Two questions:

hunainm commented 1 year ago

@sneas Thanks for a prompt response. Here are your ansers

  1. Manifest version 2
  2. I get the same error in console "VM75:1 Uncaught TypeError: Error in invocation of storage.get(optional [string|array|object] keys, function callback): No matching signature. at :1:21"
sneas commented 1 year ago

I see the problem now. Manifest v2 storage functions don't return promises https://developer.chrome.com/docs/extensions/mv3/promises/. And I tested this library with Manifest v3 only. I'm going to fix it in couple of days.

hunainm commented 1 year ago

Ah Gotcha, That would be a lifesaver. Thanks!

sneas commented 1 year ago

Hey @hunainm, the new version of @vocably/pontis is now available under the v1.0.2. I hope it'll resolve your issue.