webext-core
webext-core copied to clipboard
@webext-core/messaging errors with No response when sending data back from an injected script
Using only example code from the webext-core site, injected script messaging causes an error (No error when sending messages to the injected script) Potentially related to #55 ?
Error:
Uncaught (in promise) Error: No response
at Object.<anonymous> (chunk-ALTBYIMW.js:80:67)
at Generator.next (<anonymous>)
at fulfilled (chunk-ALTBYIMW.js:36:24)
Minimal repro: https://github.com/rcoopr/wxtcore-messaging-repro
- clone
-
pnpm i
-
pnpm dev
- check console
What steps did I do to create example:
- init WXT using
pnpm dlx wxt@latest init <project-name>
-
pnpm i @webext-core/messaging
- Add permissions for injected script to wxt config
- Copy code from https://webext-core.aklinker1.io/guide/messaging/#window-messaging (Also, there is a typo,
browser.runtime.getUrl
is actuallygetURL
) - run
pnpm dev
and check console
The messages are recieved, yet there is an error anyway. The issue is also present in the built output. Only tested on Chrome 122