vuelidate: TypeScript errors out of the box
I have a Vue project with TypeScript, and just with this code block I’m getting a type error:
Argument of type 'PluginFunction<any>' is not assignable to parameter of type 'PluginObject<any> | PluginFunction<any>'.
import Vue from 'vue';
import Vuelidate from 'vuelidate';
Vue.use(Vuelidate);
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 2
- Comments: 18
I had the same problem with similar tsconfig.json. I used yarn in project. As playgound worked fine and neighter deleting node_modules and reinstalling did not helped I expected some tsconfig issue. After some hours of many changes of tsconfig and googling, I found Jan Esser’s comment about two versions of vue in project (https://github.com/vuelidate/vuelidate/pull/287). Confirmed that this was the case.
Problem was caused by yarn duplicates of vue package in yarn.lock. Helped using yarn-deduplicate to fix duplicates followed by yarn install. It worked correctly now. Thank you Jan for good job.
Versions:
Problem
have the same issue with vue 3 + ts.
this code triggers an error.
@mvandak thanks, works fine. After that, close and re open VSC to get the changes.
I can say, after running
yarn-deduplicatethe issues are over!Same error, did you resolve this?