Skip to content

Does Nuxt fully support the latest Vue Functional Components?  #2565

@pxwee5

Description

@pxwee5

As per topic. Because I tried

<template functional>
  <div>Test Functional</div>
</template>

When I do a page refresh, I got this error _vm._ssrNode is not a function

Not sure what I'm doing wrong. If someone could point me in the right direction it will be great.

This bug report is available on Nuxt.js community (#c2230)

Activity

mouafa

mouafa commented on Feb 16, 2018

@mouafa

@pxwee5 try to add the current snippet to your nuxt.config.js and make sure you're not lazy loading them otherwise you'll encounter this #2841

build: {
    extend(config) {
      //fix for _vm._ssrNode is not a function for functional component
      config.module.rules.forEach(rule => {
        if (rule.test.toString() === '/\\.vue$/') {
          rule.options.optimizeSSR = false
        }
      })
    }
  }
timwis

timwis commented on Feb 16, 2018

@timwis

@mouafa doesn't that have a side-effect of...not optimizing SSR for vue component files, including non-functional ones?

mouafa

mouafa commented on Feb 19, 2018

@mouafa

@timwis I'm not sure, the documentation description says

Enable Vue 2.4 SSR compilation optimization that compiles part of the vdom trees returned by render functions into plain strings, which improves SSR performance. In some cases you might want to explicitly turn it off because the resulting render functions can only be used for SSR and cannot be used for client-side rendering or testing.

But since we're generating a static site this might only affect the build time.

40 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @TheAlexLichter@timwis@mouafa@clarkdo@pxwee5

      Issue actions

        Does Nuxt fully support the latest Vue Functional Components? · Issue #2565 · nuxt/nuxt