praveenpuglia / vuetify-daterange-picker

The missing date range picker for Vuetify JS you have been looking for.
https://vuetify-daterange-picker.gitbook.io/docs
MIT License
197 stars 59 forks source link

version [3.1.X] is not working with latest vuetify and cli #49

Closed mohsinamjad closed 5 years ago

mohsinamjad commented 5 years ago

So i've been trying to use this module in latest vuetify setup when I try to use. It shows me error in console saying that this.$vuetify is undefined in this module.

it's working till version 3.0.0 without some props like preset, preset-label etc but on latest versions it's breaking. here is my console error

Screenshot from 2019-03-31 12-52-07

some module usage snippet Plugin ` //VuetifyDatePicker

import VuetifyDaterangePicker from "vuetify-daterange-picker";

Vue.use(VuetifyDaterangePicker) `

main.js import "vuetify-daterange-picker/dist/vuetify-daterange-picker.css"

some-component.vue <v-daterange ..../>

figurluk commented 5 years ago

i have same issue

praveenpuglia commented 5 years ago

On initial inspection it doesn't look like a bug in the component at all. Read more - https://github.com/yariksav/vuetify-confirm/issues/9

It looks like something has changed about how vuetify gets installed and in vuetify's code and this.$vuetify is undefined.

Can you please put your App.vue, main.js and vuetify plugin installation code?

praveenpuglia commented 5 years ago

I somehow seem to have fixed it in 3.1.6. It's a weird thing and I am not sure of is right or wrong.

I had to remove vue, vuetify, and date-fns from dependencies and add them to peerDependencies. But then doing yarn added them back to dependencies.

So, I had to do an npm install those three modules and then remove the generated package-lock.json so i would still have them in my node modules but not in dependencies.

Then built and published.

Can you all try the 3.1.6 release and see if that solves?

praveenpuglia commented 5 years ago

I moved to devDependencies so I can do dev work and still not get into a localVue vs globalVue conflict.

This should have been very obvious that I need to use devDependences for dev work

Ref - https://github.com/praveenpuglia/vuetify-daterange-picker/commit/a55a7c94d8c22d367a269feba0a69ac1ea3884a0

lukaVarga commented 5 years ago

I somehow seem to have fixed it in 3.1.6. It's a weird thing and I am not sure of is right or wrong.

I had to remove vue, vuetify, and date-fns from dependencies and add them to peerDependencies. But then doing yarn added them back to dependencies.

So, I had to do an npm install those three modules and then remove the generated package-lock.json so i would still have them in my node modules but not in dependencies.

Then built and published.

Can you all try the 3.1.6 release and see if that solves?

@praveenpuglia the date-fns seem to be a dependency, though, as adding the vuetify-daterange-picker@3 now breaks build:

This dependency was not found:   
* date-fns in ./node_modules/vuetify-daterange-picker/dist/vuetify-daterange-picker.common.js 

To install it, you can run: npm install --save date-fns 
praveenpuglia commented 5 years ago

That is correct. It is because I expect the application developer to install that library. And that is because I want one single version of date-fns being used in case the author also wants to use date-fns for other parts of the application.