question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build error with yup latest version `^0.32.0`

See original GitHub issue

Bug 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:open
  • Created 3 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
holiccommented, Mar 29, 2021

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 TS errors.

(Unfortunately older versions of yup have a many more TS errors)

0reactions
stale[bot]commented, Apr 16, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found