You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Component throws an error and doesn't render any content
TypeError: Cannot read property 'name' of undefined
at createSlots (https://unpkg.com/vue@3.0.0-alpha.7/dist/vue.global.js:9054:26)
at Proxy.render (eval at compileToFunction (https://unpkg.com/vue@3.0.0-alpha.7/dist/vue.global.js:10172:24), <anonymous>:15:44)
at renderComponentRoot (https://unpkg.com/vue@3.0.0-alpha.7/dist/vue.global.js:5056:55)
at componentEffect (https://unpkg.com/vue@3.0.0-alpha.7/dist/vue.global.js:6891:55)
at run (https://unpkg.com/vue@3.0.0-alpha.7/dist/vue.global.js:4060:22)
at reactiveEffect (https://unpkg.com/vue@3.0.0-alpha.7/dist/vue.global.js:4041:18)
at effect (https://unpkg.com/vue@3.0.0-alpha.7/dist/vue.global.js:4026:11)
at setupRenderEffect (https://unpkg.com/vue@3.0.0-alpha.7/dist/vue.global.js:6889:29)
at mountComponent (https://unpkg.com/vue@3.0.0-alpha.7/dist/vue.global.js:6882:11)
at processComponent (https://unpkg.com/vue@3.0.0-alpha.7/dist/vue.global.js:6808:19)
I realize this might not be a common use case, but the practice of passing slot content to child components is useful for complex library components.
My use case is porting an autocomplete component from the v2 composition-api plugin to v3. One of the slots on the base component, Autocomplete, is named "suggestion", which, if it exists, is handed to the inner AutocompleteList component. It works fine with the v2 plugin but is broken in v3.
This bug also shows up if the fallback content is set for the named slot, which is strange because I would expect that fallback to create the necessary render function.
Version
3.0.0-alpha.7
Reproduction link
https://codesandbox.io/s/vue-3-slot-drilling-error-92srn
Steps to reproduce
Open the sandbox and check the console
What is expected?
Missing slots skip rendering.
What is actually happening?
Component throws an error and doesn't render any content
I realize this might not be a common use case, but the practice of passing slot content to child components is useful for complex library components.
My use case is porting an autocomplete component from the v2 composition-api plugin to v3. One of the slots on the base component,
Autocomplete
, is named"suggestion"
, which, if it exists, is handed to the innerAutocompleteList
component. It works fine with the v2 plugin but is broken in v3.This bug also shows up if the fallback content is set for the named slot, which is strange because I would expect that fallback to create the necessary render function.
Offending Code:
https://github.com/vuejs/vue-next/blob/master/packages/runtime-core/src/helpers/createSlots.ts#L22
The text was updated successfully, but these errors were encountered: