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

Multiple root nodes returned from render function. #108

Open
mateuszlubianka1993 opened this issue Jun 30, 2021 · 1 comment
Open

Multiple root nodes returned from render function. #108

mateuszlubianka1993 opened this issue Jun 30, 2021 · 1 comment

Comments

@mateuszlubianka1993
Copy link

Subject:
I want to use vue-lazy-hydration, but when i try i always get the same warn:

[Vue warn]: Multiple root nodes returned from render function. Render function should return a single root node.

And the component is not showing.

I have tried with many different components.

Example code:

<template>
  <div class="icons-box">
    <LazyHydrate when-idle>
      <MiniCartDropdown v-if="something"/>
    </LazyHydrate>
  </div>
</template>
</script>
<script>
import LazyHydrate from 'vue-lazy-hydration';

export default {
  name: 'IconsBox',
  props: ['onClickMenu'],
  components: {
    LazyHydrate,
    MiniCartDropdown: () => import('@/modules/cart/_components/_miniCart/MiniCartDropdown.vue'),
  },
  data() {
    return {
      isCartDropdownOpen: false,
    };
  },
};
</script>

I also tried this way:

ImageSlider: hydrateWhenIdle(() => import('./ImageSlider.vue')),

but also the same error occurs.

Do you know what could be causing the problem?
If more details are needed, I will provide them.

@maoberlehner
Copy link
Owner

Code looks correct. Please add a link to CodeSandbox reproduction.

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

No branches or pull requests

2 participants