vue-tel-input icon indicating copy to clipboard operation
vue-tel-input copied to clipboard

"render function or template not defined in component: vue-tel-input" in Nuxt.js

Open leonelsanchesdasilva opened this issue 4 years ago • 5 comments

Steps to simulate:

  • Start a new Nuxt.js project;

  • Install vue-tel-input package, version 4.3.0;

  • In plugins, configure the following:

      import Vue from 'vue';
      import VueTelInput from 'vue-tel-input';
    
      Vue.component('vue-tel-input', VueTelInput);
      // or Vue.use(VueTelInput);
    
  • Add the plugin in plugins section (nuxt.config.js):

      plugins: [
          ...
          { src: '~/plugins/vue-tel-input.js', mode: 'client' }
      ]
    
  • Add the component in some page:

      <template>
          <vue-tel-input v-model="phone"></vue-tel-input>
      </template>
    

Error message:

Render function or template not defined in component: vue-tel-input

Notes:

  • Component works normally at version 4.0.0. The problem is at version 4.3.0.

leonelsanchesdasilva avatar Feb 15 '20 20:02 leonelsanchesdasilva

Do you have your code available somewhere? Everything is fine in the demo from codesandbox: https://codesandbox.io/s/vue-tel-input-nuxt-demo-1l93b

iamstevendao avatar Feb 16 '20 09:02 iamstevendao

You have to put VueTelInput into brackets like this. import { VueTelInput } from 'vue-tel-input';

yofade3 avatar Mar 20 '20 14:03 yofade3

component is not working on SSR, have to wrap it with <client-only>

andreynazarov3 avatar Mar 23 '20 11:03 andreynazarov3

@yofade3 thank you

clouedoc avatar Mar 31 '20 16:03 clouedoc

Hey guys, it seems the component no longer works on newer versions in nuxt. I think it's happening since this PR: https://github.com/iamstevendao/vue-tel-input/pull/172

Forked with "vue-tel-input": "5.6.2": https://codesandbox.io/s/vue-tel-input-nuxt-demo-forked-z8n7p any idea on how to solve this?

thanks.

elvinguti avatar Sep 28 '21 19:09 elvinguti