-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Build error when use module path to import a SFC from dependency. #451
Comments
I have encountered this problem. Thanks to the workaround. |
If we remove
which means the |
I've also had this with plugins instead of SFC's. I solved it using the workaround. The interesting thing was that it borked on one plugin, while it did not on the other. This enhanceApp.js works, in other words:
When I try to import VueStatic normally, this is the stack trace:
|
I am trying to figure this out. From what I do understand, this would work for importing a Vue plugin to use in your custom vuepress component. Is there a way of doing this in a way that would allow you to use another (non-vue) js library (e.g. axios) within your custom component? |
Come from #1414. Does anyone know the cause of problem now? |
#1539 😅 Quick fix for you: // .vuepress/config.js
module.exports = {
chainWebpack(config) {
config.externals([/^(vue|vue-router)$/])
}
} |
This issue was from #443, the fastest reproduction is:
lib/app/app.js
:yarn dev
work properly, but runyarn build
you'll get the error:All will work after this change.
That is to say, when we import a SFC from dependency, we must import it in
absolute path
orrelative path
instead of[moduleName]/rest-relative-path
. or it will cause the build to be wrong:I checked the vue-loader's code and doc, and also our webpack config, but still cannot get a clear answer and fix.
@yyx990803 Do you have any advice? thanks!
The text was updated successfully, but these errors were encountered: