Running into "Could not establish connection. Receiving end does not exist" #205
-
Hey folks! I've been trying to implement this in my code, but unable to get it to work. Here's what I currently have:
in my background.js and:
in my code but when I run it I get this error in my console:
I'm using webpack to build the extension and installed the library using:
Can anyone please help me understand what I'm doing incorrectly. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hey Arsh, responding here instead of in email so others might benefit as well. I'm not sure what this error is. Does it happen when you try the sample extension? https://github.com/Glench/ExtPay/tree/main/sample-extension-mv3 If not, I expect it would be something with your code. And can you show a screenshot of the network panel? I want to know what URL ExtPay is trying to connect to and if that's what's causing the error you're receiving. |
Beta Was this translation helpful? Give feedback.
-
Thanks for taking a look at this @Glench! I tried the sample extension and that seems to be working. But for our extension, when we look at the network tab I can't see any requests that ExtensionPay is making. I have attached the screenshot below. None of the network requests you see in the image were made by Extension Pay when I checked. I think the error has to do with how we have Webpack configured currently. But I'm not able to figure out what exactly are we doing wrong. Right now all our files our bundled into
Could it be because of this it's not picking up the installed npm package for ExtensionPay? |
Beta Was this translation helpful? Give feedback.
OK, thanks for providing all that. It looks like it's not an ExtPay issue so I agree it's probably a webpack issue. Unfortunately I don't know much about webpack but maybe you can look through the source it outputs to see if it's actually pulling in ExtPay correctly.
And it looks like that particular error you saw often happens when an extension's content script tries to contact the background worker but the background worker doesn't have a message handler set up. So that might give you a clue as to what's happening.