-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
children component doesn't compile successful #2064
Comments
Is this a problem in rollup-plugin-vue @znck ? |
As per spec component name should start with an upper case character. Compiler is treating helloworld as custom element. |
What do you mean? the component is named |
The source code is <HelloWorld msg="Hello Vue in Fenice!" /> |
I am checking. |
@posva Somehow |
it's weird because it works with vite |
For what it's worth, I saw that same error message in a Webpack project. In that project the problem seemed to be that 2 copies of Vue were being pulled in. From a quick look at that CodeSandbox it looks like it could be the same problem. |
The reason is like @skirtles-code said, and should modify the // rollup.config.js
export default {
output: {
// ...
globals: { vue: 'Vue' }
},
// ...
external: ['vue']
} |
Ah, nice catch. Didn't notice they were using different Vue versions. Sorry for the noise @znck 😓 |
Thank you for your help. It was a mistake I wasn't aware of. 😓 |
Is there a solution that doesn't require roll-up? |
Modify the build configuration so that the vue use the same. @lukef // rollup.config.js
export default {
output: {
// ...
globals: { vue: 'Vue' }
},
// ...
external: ['vue']
}`
|
@lukef have you ever figured it out? @skyweaver213 the I have the same issue, a UI library with multiple parent/child components. when I install it directly from NPM, everything works, but when working with For what it’s worth, it works w/out problems with Vite. |
@kris-ellery I'm having the same issue as you, any chance you've managed to find a fix? |
@tomhrtly I stopped looking once I got it working with Vite. |
anyone got any clues how to resolve this with webpack? experiencing the same thing. |
Even if the library is being built correctly, it can still fail if you try to include it using With webpack and Vue CLI I managed to get it working using the following code in const path = require('path')
module.exports = {
configureWebpack: {
resolve: {
symlinks: false,
alias: {
vue: path.resolve('./node_modules/vue')
}
}
}
} I would imagine something similar would work without Vue CLI if the same configuration is moved to the relevant place in the webpack config. The idea to use an The It's not elegant but it did resolve the problem in the cases I tried. For anyone using Vite for their application, I believe you'd need to include export default {
resolve: {
dedupe: ['vue']
}
} Another potential cause of this problem is not importing Vue as import { createApp } from 'vue' and NOT this: import { createApp } from 'vue/dist/vue.esm-browser.js' |
Just wanted to confirm that using the "resolve" entry that @skirtles-code provided allows me to do a 'yarn link' to a library I am trying to help convert over to Vue 3. Prior to that, I had to point to a github repository and do a push to get the library to work correctly. I was having the same issue that a second version of Vue was being pulled out of the node_modules of the library and preventing rendering of the library's components. The application the library was being used in is using webpack 4.43.x |
Same here. And the @skirtles-code solution don't work for me. |
Version
"vue": "^3.0.0-rc.10",
"@vue/compiler-sfc": "^3.0.0-rc.10",
"rollup-plugin-vue": "^6.0.0-beta.10"
Reproduction link
https://codesandbox.io/s/cocky-noyce-6zi8p?file=/index.html
Steps to reproduce
What is expected?
The children component should be compile.
What is actually happening?
App.vue Children component <helloworld/> doesn’t compile successfully.
The text was updated successfully, but these errors were encountered: