Nuxt.js: Functional components not worked if import dynamically with SSR context

Created on 20 Nov 2020  路  1Comment  路  Source: nuxt/nuxt.js

Versions

  • nuxt: 2.14.7
  • node: 14

Reproduction

Import functional component dynamically on page

Steps to reproduce

0) Create functional component like this:
/components/UiPageTitle.vue

<template lang="pug" functional>
  header.ui-page-title(
    v-bind="data.attrs",
    v-on="listeners",
    :ref="data.ref",
    :class="[data.staticClass, data.class]"
    )
    .ui-page-title__content
      .ui-page-title__prefix(v-if="!!(data.scopedSlots && data.scopedSlots.prefix)")
        slot(name="prefix")
      .ui-page-title__place
        slot
      .ui-page-title__tools(v-if="!!(data.scopedSlots && data.scopedSlots.tools)")
        slot(name="tools")
    .ui-page-title__footer(v-if="!!(data.scopedSlots && data.scopedSlots.footer)")
      slot(name="footer")
</template>

1) Import this component dynamically on the page:
pages/index.vue:

<template lang="pug">
  div
    ui-page-title
      h1 Heading 1
</template>
<script>
export default {
    name: 'IndexPage',
    components: {
        UiPageTitle: () => import('~/components/UiPageTitle')
    }
}
</script>

What is Expected?

Everything works

What is actually happening?

TypeError
_vm._ssrNode is not a function
bug-report

Most helpful comment

>All comments

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lazycrazy picture lazycrazy  路  3Comments

uptownhr picture uptownhr  路  3Comments

vadimsg picture vadimsg  路  3Comments

surmon-china picture surmon-china  路  3Comments

VincentLoy picture VincentLoy  路  3Comments