"vue": "^3.0.0-rc.10",
"@vue/compiler-sfc": "^3.0.0-rc.10",
"rollup-plugin-vue": "^6.0.0-beta.10"
https://codesandbox.io/s/cocky-noyce-6zi8p?file=/index.html
The children component should be compile.
App.vue Children component \
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 HelloWorld and used as <HelloWorld/>
What do you mean? the component is named
HelloWorldand used as<HelloWorld/>
The source code is \

@znck @posva
I am checking.
@posva Somehow currentRenderingInstance is missing and resolveComponent depends on it. RPV is working fine. Did we make any changes to currentRenderingInstance?

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. resolveAsset in a pre-built component was hitting a different Vue from the surrounding application, so it had a different currentRenderingInstance.
From a quick look at that CodeSandbox it looks like it could be the same problem. vue.global.js seems to be doing the majority of the work but it's reaching out to something inside /dist/home/index.js to render the component.
The reason is like @skirtles-code said, and should modify the rollup.config.js to solve that issue:
// 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. 😓
@skirtles-code @HcySunYang @znck @posva
Is there a solution that doesn't require roll-up?
Is there a solution that doesn't require roll-up?
Modify the build configuration so that the vue use the same. @lukef
If use rollup, like this:
``js
// rollup.config.js
export default {
output: {
// ...
globals: { vue: 'Vue' }
},
// ...
external: ['vue']
}
@lukef have you ever figured it out? @skyweaver213 the globals: { vue: 'Vue' } does not work for ESM output.
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 npm link, or even relative path, it throws resolveComponent can only be used in render() or setup(). From what I gathered it's due to multiple copies of Vue.
For what it’s worth, it works w/out problems with Vite.
Most helpful comment
The reason is like @skirtles-code said, and should modify the
rollup.config.jsto solve that issue: