-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error loading vue component in vite3 #462
Comments
No problem in vite 2.x |
This is an issue with react on vite 3.x, probably a compatibility issue with vite 3. |
@jacksteamdev +1 I've also got this issue which is a bit of a show stopper. Everything works on build, but crashes on dev:
I made a minimal reproduction repo with I tried for a long time to patch it locally with |
FYI @keyding @jacksteamdev this is not a problem if downgrading to:
The latest versions of each are what seems to be breaking this:
|
For now, I suggest downgrading as @saxoncameron describes. CRXJS support for Vite 3 will land in or directly after #427. The file writer rewrite will fix this resolution problem at the root and simplify things immensely. Vite made some big internal changes that affect not only path resolution, but also CRXJS test architecture. I already spent a full day figuring out what was wrong, but it will be sometime in September before I can finish both the new File Writer and full Vite 3 support. |
@jacksteamdev Thank you for your dedication to this. |
@jacksteamdev [plugin:crx:manifest-loader] context method emitFile() is not supported in serve mode. This plugin is likely not vite-compatible. Doesn't seem to affect my ability to run dev mode, or the build though...? |
@jacksteamdev any idea why this warning would be popping up now, but not in the past? Did you add some plugin compatibility warnings in the beta or something? Just wondering if this ought to concern me or not |
I confirm that on the latest |
@stefanozanella so you have solve this problem loading vue component by using |
@stefanozanella I have use 2.0.0-beta.4 solved dev mode Error problem ,but the content scrip doesn't work anymore |
@jacksteamdev I want to know that do you have solved this problem now.I still have this problem in |
I have a similar problem. |
Downgraded "@vitejs/plugin-vue" and "vite" as instructed in this thread crxjs/chrome-extension-tools#462 (comment)
EDIT: Nevermind, I managed to fix it by switching to the newest beta version of crxjs. Hi, I'm having the exact same problem.
content script:
Error: I've confirmed that the cause is l4 in the content script |
I suffered for 30 mins and figured out the fix. it now compiles and works in dev Problem
const EXPORT_HELPER_RE = /plugin-vue:export-helper/
const INTERNAL_VUE_HELPER_ID = 'INTERNAL_VUE_HELPER_ID'
const helperCode = `
export default (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
}
`
function ExportHelperPlugin(): Plugin {
return {
name: 'vue-export-helper',
resolveId(id) {
if (EXPORT_HELPER_RE.test(id))
return INTERNAL_VUE_HELPER_ID
},
load(id) {
if (id === INTERNAL_VUE_HELPER_ID)
return helperCode
},
}
} ref:
|
Thanks for contributing to CRXJS! This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within 7 days. |
Build tool
Vite
Where do you see the problem?
Describe the bug
Error message after running
pnpm dev
Import
HelloWorld.vue
component incontent-scripts.ts
Reproduction
https://github.com/keyding/vite3-crx
Logs
No response
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: