Home » vue » Failed to mount component – using vue-airbnb-style-datepicker

Failed to mount component – using vue-airbnb-style-datepicker

Posted by: admin November 26, 2021 Leave a comment


Trying vue-airbnb-style-datepicker

imported in my file.vue:

import AirbnbStyleDatepicker from 'vue-airbnb-style-datepicker'
import format from 'date-fns/format'

export default {
  components: {

enter image description here

But i’m getting an error: Failed to mount component: template or render function not defined.

Versions in package.json:

"date-fns": "^1.29.0",
"vue": "^2.5.2",
"vue-airbnb-style-datepicker": "^1.11.4",


enter image description here


It will work if you follow installation guide and register it globally:

import Vue from 'vue'
import App from './App.vue'

// import component and stylesheet
import AirbnbStyleDatepicker from 'vue-airbnb-style-datepicker'
import 'vue-airbnb-style-datepicker/dist/styles.css'

// see docs for available options
const datepickerOptions = {}

// make sure we can use it in our components
Vue.use(AirbnbStyleDatepicker, datepickerOptions)