Closed Rookiewan closed 1 year ago
Hey @Rookiewan 👋 Thanks for putting together this issue!
This error happens when Vite adds the Vite client to the Vue component. CRXJS modifies the client to work in a content script, but the content script relies on the Chrome API (whis is only available to content scripts, not injected scripts).
Usually, an injected main world script is plain vanilla JavaScript. CRXJS supports frameworks like Vue in a content script, but not necessarily in a main-world script.
What are you doing with an injected script that you can't with a content script?
Build tool
Vite
Where do you see the problem?
Describe the bug
inject/index.ts
content/index.ts
import injectJsDemoSrc from '../inject/index.ts?script&module'
and insert into bodyerror
but build success
Reproduction
run
yarn dev
Logs
System Info
Severity
blocking all usage of RPCE