Build error with yup latest version `^0.32.0`
See original GitHub issueBug report
- I have checked other issues to make sure this is not a duplicate.
Describe the bug
If in the project is installed yup@^0.32.0
build fails with errors:
../../node_modules/graphql-shield/dist/constructors.d.ts:39:122 - error TS2694: Namespace '".../node_modules/yup/lib/index"' has no exported member 'Schema'.
39 export declare const inputRule: <T>(name?: string | undefined) => (schema: (yup: typeof Yup, ctx: IShieldContext) => Yup.Schema<T, object>, options?: Yup.ValidateOptions<object> | undefined) => InputRule<T>;
~~~~~~
../../node_modules/graphql-shield/dist/constructors.d.ts:39:155 - error TS2694: Namespace '".../node_modules/yup/lib/index"' has no exported member 'ValidateOptions'.
39 export declare const inputRule: <T>(name?: string | undefined) => (schema: (yup: typeof Yup, ctx: IShieldContext) => Yup.Schema<T, object>, options?: Yup.ValidateOptions<object> | undefined) => InputRule<T>;
~~~~~~~~~~~~~~~
../../node_modules/graphql-shield/dist/rules.d.ts:69:85 - error TS2694: Namespace '".../node_modules/yup/lib/index"' has no exported member 'Schema'.
69 constructor(name: string, schema: (yup: typeof Yup, ctx: IShieldContext) => Yup.Schema<T>, options?: Yup.ValidateOptions);
~~~~~~
../../node_modules/graphql-shield/dist/rules.d.ts:69:110 - error TS2694: Namespace '".../node_modules/yup/lib/index"' has no exported member 'ValidateOptions'.
69 constructor(name: string, schema: (yup: typeof Yup, ctx: IShieldContext) => Yup.Schema<T>, options?: Yup.ValidateOptions);
~~~~~~~~~~~~~~~
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
import { rule } from 'graphql-shield';
export const r = rule()((): boolean => false);
Add yup to the project and build typescript:
yarn add yup@latest
tsc
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
Build error with yup latest version ^0.32.0 #1087 - GitHub
I just came across this issue too. I'm attempting to use nexus-validate (which requires yup to be installed) but yup^0.32 causes the above...
Read more >Yup 0.32.0+ doesn't work with basic types - a workaround?
Since version 0.32 of Yup validation library, it's not anymore possible to define a basic schema like: import yup from "yup"; ...
Read more >Keywords - yup - npm
Latest version : 0.32.11, last published: a year ago. Start using yup in your project by running `npm i yup`. There are 3993...
Read more >yup - npm.io
Check Yup 0.32.11 package - Last release 0.32.11 with MIT licence at our NPM ... If any message is missing in the custom...
Read more >yup-schema-faker - NPM Package Overview - Socket.dev
Yup -schema-faker will generate you a fake data based on your yup schema. Version: 5.0.0 was published by iendeavor.
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 FreeTop 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
Top GitHub Comments
I just came across this issue too. I’m attempting to use
nexus-validate
(which requiresyup
to be installed) but yup^0.32 causes the above TS errors.(Unfortunately older versions of yup have a many more TS errors)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.