wxt-dev / wxt

⚡ Next-gen Web Extension Framework
https://wxt.dev
MIT License
4.15k stars 169 forks source link

vuetify components error #668

Closed QuietlyChan closed 4 months ago

QuietlyChan commented 4 months ago

test.zip

未命名

When using vuetify components, I encountered the above error. I can use other components normally, so is this a problem with this component library, or did I import it incorrectly?

QuietlyChan commented 4 months ago

I've noticed that not only the vuetifyjs library but also the primevue library seems to have issues. It appears that newer libraries tend to report errors directly. However, when I use libraries such as elementUI, vant, or tdesign, I don't encounter any problems. This leads me to believe that there might be compatibility issues between different libraries and wxt. Could you please provide some insight or guidance on this matter? Thank you.

aklinker1 commented 4 months ago

WXT has to load the entrypoints during the build process to get their metadata, like the content script's matches, to generate the manifest. During this process, WXT removes all imports to make sure browser code doesn't run in a node environment. you can see this by running wxt prepare --debug.

In this case, it's not removing all imports. Specifically, looks like my regex used to remove the imports doesn't catch import * as ... statements:

Screenshot 2024-05-24 at 5 26 54 AM

So it's trying to run browser code in node, and it's failing.

I'll update the regex

aklinker1 commented 4 months ago

Released in v0.18.3