Closed AlejandroMut closed 2 years ago
hm, great ;) seems like
import { isVue3 } from 'vue-demi';
export default isVue3 ? Component3 : Component2;
resolves to Component3
in your case somehow. Can you please check isVue3
from vue-demi
. Is it true or false? if true then probably it's related to vue-demi
Hi... How can I check that if my app won't compile and run? I don't even use vue-demi in the app, it´s just the dependency on vue-imask.
I am having the exact same issue. I don't have vue-demi, but because it's a dependency of this package and it won't compile when using Vue2. Fails with the same error. I did see something at the vue-demi repo about this error - it was a matter of resolving the path to composition API - but they were using NUXT in that case.
Same, I am using Vue3 without vue-demi and having the exact the same issue here.
@jzs11 your issue doesn't seem to be related to this particular package (vue-imask)... More like vueuse.
So i need to support both vue 2 and vue 3 for now. Using vue-demi
seems the best way. But for vue 2 it means that you need to do some more steps to get it work. I will add it in a guide of course a bit later.
npm i -D @vue/composition-api
should solve the problem.
and
If you are using NuxtJS you also need @nuxtjs/composition-api:
npm i -D @nuxtjs/composition-api
And then add '@nuxtjs/composition-api/module' in the buildModules option in your nuxt.config.js.
I assume that update will be a major semver bump as it’s a breaking change?
@alexcroox agreed this should definitely be a major version change. However I don't think I'll be updating vue-imask if I need to add two additional packages to my project. I'd rather stick to v6.0.7 until I update my project to Nuxt/Vue 3.
it should be probably. I was checking it in my local environment and vue2 worked well without installing additional things. So supposed to be seamless, but... Anyway API for vue2 was not changed.
@alexcroox agreed this should definitely be a major version change. However I don't think I'll be updating vue-imask if I need to add two additional packages to my project. I'd rather stick to v6.0.7 until I update my project to Nuxt/Vue 3.
as i understood from vue-demi
guide it will not be included in final build if your bundler supports tree-shaking. but it needs to be proved. At least in imask
i don't use composition-api
for vue2 component.
@alexcroox agreed this should definitely be a major version change. However I don't think I'll be updating vue-imask if I need to add two additional packages to my project. I'd rather stick to v6.0.7 until I update my project to Nuxt/Vue 3.
as i understood from
vue-demi
guide it will not be included in final build if your bundler supports tree-shaking. but it needs to be proved. At least inimask
i don't usecomposition-api
for vue2 component.
Was composition-api packaged with imask in the past and then removed? I've used this package for a little while and only started having issues around the time this ticket was opened.
Describe the bug The vue-imask plugin is not compiling on Vue2 app. Throws an error related to vue-demi
To Reproduce build or run dev a Vue2 (or Nuxt) app using vue-imask
Expected behavior A clear and concise description of what you expected to happen.
Environment:
Additional context Output: