component with a slot from a component library is crashing the main vue application
Version
3.2.6
Reproduction link
Steps to reproduce
- build the component library with a component having a slot
- use the component in the host application and it crashes
What is expected?
Host application should run without any issues and render the component with slot
What is actually happening?
Host application is crashing with the following error Uncaught (in promise) TypeError: Cannot read property 'isCE' of null at renderSlot (runtime-core.esm-bundler.js?38c8:6125) at eval (Link.vue?944e:6) at normalizeChildren (runtime-core.esm-bundler.js?38c8:5980) at createBaseVNode (runtime-core.esm-bundler.js?38c8:5742) at _createVNode (runtime-core.esm-bundler.js?38c8:5835) at createVNodeWithArgsTransform (runtime-core.esm-bundler.js?38c8:5700) at createBlock (runtime-core.esm-bundler.js?38c8:5675) at Proxy.render (Link.vue?944e:5) at renderComponentRoot (runtime-core.esm-bundler.js?a40c:761) at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js?a40c:4529)
There is also the following warning
runtime-core.esm-bundler.js?a40c:6873 [Vue warn]: Unhandled error during execution of scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next
at
The linked repo has been created by fatawesome and credit for reproducing goes to them. We stumbled up on the repo when we were searching for similar issue reports. Will create a git repo if its not enough.
Our case is similar 1. We have a component library with component having a slot 2. We have host vue application using the component. Both projects are on 3.2.6.
Your reproduction is not minimal, please read and follow https://new-issue.vuejs.org/?repo=vuejs/vue-next#why-repro when reporting a bug. Most bugs should be reproducible with the SFC Playground.
@posva i di see a github repo link above in the description. And the issue is during build step. Could you please let us know why the bug is closed?
@posva - i guess we did not search well enough on the issue. We found the solution for the issue at https://github.com/vuejs/vue-next/issues/4344. Thanks for the time.
@posva i di see a github repo link above in the description. And the issue is during build step. Could you please let us know why the bug is closed?
Please ignore.
For anyone who has similar issues to what we had. The root cause seems to be we are including our component library with npm link: locally in the main application. Adding the following two lines to vue.config.js fixed the issue.
`config.resolve.symlinks(false)
config.resolve.alias.set( 'vue', path.resolve('./node_modules/vue')`
After this the chainWebpack of vue.config.js should look something like
`const path = require('path')
module.exports = { lintOnSave: false, chainWebpack(config) { config.resolve.symlinks(false)
config.resolve.alias.set( 'vue', path.resolve('./node_modules/vue'))
//config.externals([{"vue-router": "vue-router"}])
},
//commented rest for brevity`