Tess
Issue with Dynamic Components Loading nuxt 3
Hello everyone,
I have a composable useComponentRegistry, which is supposed to load a component either from the core or from a custom registry if it exists. The function looks like this:
When I try to render the component dynamically like this:
I get errors during the build process : Cannot read properties of null (reading 'ce'), Cannot destructure property 'type' of 'vnode' as it is null, Warn: resolveComponent can only be used in render() or setup(), Unhandled error during execution of render function. After the build, there are no more errors, and the components work as expected.
When I pass the banners prop directly to the SliderBanners component like this, it works perfectly fine:
<SliderBanners :banners="banners"></SliderBanners>
I’m wondering if there’s something wrong with how I’m using useComponentRegistry for dynamic component loading or if there’s something specific I’m missing when passing props dynamically. Is there a best way to load my custom components if exist ? I'm currently blocked because the import cannot handle dynamic variables with subdirectories.
Thank you!
7 replies