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.

Property 'enter' does not exist on type '{ readonly enter?: ASTVisitFn<NameNode> ...

See original GitHub issue

Describe the bug

Getting the following build errors with TS:

node_modules/@graphql-codegen/plugin-helpers/oldVisit.d.ts:5:75 - error TS2339: Property 'enter' does not exist on type '{ readonly enter?: ASTVisitFn<NameNode> | undefined; readonly leave: ASTReducerFn<NameNode, unknown>; } | { readonly enter?: ASTVisitFn<DocumentNode> | undefined; readonly leave: ASTReducerFn<...>; } | ... 41 more ... | undefined'.

5     enter?: Partial<Record<keyof NewVisitor, NewVisitor[keyof NewVisitor]['enter']>>;
                                                                            ~~~~~~~

node_modules/@graphql-codegen/plugin-helpers/oldVisit.d.ts:6:75 - error TS2339: Property 'leave' does not exist on type '{ readonly enter?: ASTVisitFn<NameNode> | undefined; readonly leave: ASTReducerFn<NameNode, unknown>; } | { readonly enter?: ASTVisitFn<DocumentNode> | undefined; readonly leave: ASTReducerFn<...>; } | ... 41 more ... | undefined'.

6     leave?: Partial<Record<keyof NewVisitor, NewVisitor[keyof NewVisitor]['leave']>>;

To Reproduce

Use together:

    "@graphql-codegen/plugin-helpers": "^2.4.1",
    "graphql": "^16.3.0"

Then just importing it will trigger the bug:

import type { Types } from '@graphql-codegen/plugin-helpers';
  1. My GraphQL schema:
N/A
  1. My GraphQL operations:
N/A
  1. My codegen.yml config file:
N/A

Expected behavior

Not produce build errors.

Environment:

  • OS: macOS
  • @graphql-codegen/plugin-helpers: 2.4.1
  • NodeJS: v14.17.6

Additional context

N/A

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:15

github_iconTop GitHub Comments

1reaction
moltarcommented, Feb 14, 2022

If not, could you send here the portion of your lockfile (yarn or npm) that shows the graphql version resolution?

Will do, if I can repro the issue again.

1reaction
moltarcommented, Feb 14, 2022

Do you have any version of graphql installed globally?

Good question.

Seems like no?

❯ npm ls -g graphql
/Users/xyz/.fnm/node-versions/v14.17.6/installation/lib
└── (empty)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Property 'value' does not exist on type 'Readonly<{}>'
error TS2339 : Property 'value' does not exist on type 'Readonly<{}>'. I got this error in the two lines I commented on the...
Read more >
Solved - Property 'X' does not exist on type 'Readonly<{}>' in ...
This error occurs when we access a prop or state property that we have not explicitly given a type inside the React class...
Read more >
React: Property 'X' does not exist on type 'Readonly<{}>'
The React.js error "Property does not exist on type 'Readonly<{}>'" occurs when we try to access the props or state of a class...
Read more >
Property missing in type 'Readonly<any>' #19624 - GitHub
Readonly is a mapped type. it is a type transformation that happens on the input, in this case any . so Readonly<any> is...
Read more >
Useful Patterns by Use Case - React TypeScript Cheatsheets
In future, the need to forwardRef may go away in React 17+, but for now we still have ... {/* Error: Property 'toPrecision'...
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