Skip to content
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

component with a slot from a component library is crashing the main vue application #4478

Closed
ghost opened this issue Aug 31, 2021 · 5 comments

Comments

@ghost
Copy link

ghost commented Aug 31, 2021

Version

3.2.6

Reproduction link

github.com

Steps to reproduce

  1. build the component library with a component having a slot
  2. 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
at
at
at
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.

@posva
Copy link
Member

posva commented Aug 31, 2021

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 posva closed this as completed Aug 31, 2021
@SatyanandKommoju
Copy link

@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?

@ghost
Copy link
Author

ghost commented Sep 1, 2021

@posva - i guess we did not search well enough on the issue. We found the solution for the issue at #4344. Thanks for the time.

@SatyanandKommoju
Copy link

@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.

@ghost
Copy link
Author

ghost commented Sep 3, 2021

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`

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants