Cannot find module 'yup' or its corresponding type declarations
See original GitHub issueVersions
- vee-validate": "^4.4.0-alpha.2 and 4.3.6
- vue: 3.0.5
Describe the bug
I’m using vite/vue 3 and when I’m building my project, I got this error:
node_modules/vee-validate/dist/vee-validate.d.ts:3:66 - error TS2307: Cannot find module 'yup' or its corresponding type declarations.
3 import { SchemaOf, AnySchema, AnyObjectSchema, BaseSchema } from 'yup';
I think that yup should be added as peerDependencies in node_modules/vee-validate/package.json just like vue package
In order to fix my issue I installed it as dev dependencies in my package.
Notice: I’m not using yup at all in my validatation form process.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Yup - npm
Start using yup in your project by running `npm i yup`. ... TypeScript icon, indicating that this package has built-in type declarations.
Read more >cannot find module 'yup' or its corresponding type declarations
I think that yup should be added as peerDependencies in node_modules/vee-validate/package.json just like vue package In order to fix my issue I installed...
Read more >Cannot find module 'X' Error in TypeScript | bobbyhadz
The "Cannot find module or its corresponding type declarations" error occurs when TypeScript cannot locate a third-party or local module in our project....
Read more >How do I resolve "Cannot find module" error using Node.js?
Using npm install installs the module into the current directory only (in a subdirectory called node_modules ). Is app.js located under ...
Read more >TIL: TypeScript | Fix "TS2307: Cannot find module 'src' or its ...
... node_modules/@vue/test-utils/dist/domWrapper.d.ts:5:28 - error TS2307: Cannot find module 'src' or its corresponding type declarations.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You need to add yup types
yarn add @types/yup@aussieboi I would need to drop using yup types completely and use ‘any’ instead.
This would be a shame since that means form schema object won’t be typed anymore. On the other hand you are right about it shouldn’t error out while it is optional.
I will try to resolve this in v4.6 as I’m unsure about how to proceed at the moment.