Skip to content

Error: Method block not found #178

Description

@vahidvdn

Describe the bug
When I want to run yarn codegen , It throws this error:

Error: Method block not found

And with version "v2.0.0-beta.1", I get this error:

Error: Variable declaration not found

To Reproduce
just run : yarn codegen

OpenAPI spec file
https://github.com/7nohe/openapi-react-query-codegen/blob/main/examples/petstore.yaml

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots or logs to help explain your problem.

  • OS: [e.g. macOS]
  • Version ^1.6.2

Additional context
Add any other context about the problem here.

Activity

  1. claudioBarreira89 commented on Apr 8, 2025

    @claudioBarreira89

    Did you ever find a solution for this? I'm facing the same problem

  2. vahidvdn commented on Apr 8, 2025

    @vahidvdn
    Author

    @claudioBarreira89 Unfortunately not. I just used Orval. It just works fine.

  3. claudioBarreira89 commented on Apr 8, 2025

    @claudioBarreira89

    Just realised I was missing a peer depencency ts-morph. It worked after adding it!

  4. vahidvdn commented on Apr 8, 2025

    @vahidvdn
    Author

    Interesting! However, it's not mentioned anywhere, or at least I didn't see it

  5. Etsija commented on Aug 8, 2025

    @Etsija

    We tried adding ts-morph as a peer dependency to our project, but it didn't help. This error prevents us from updating to TypeScript v5.9.2.

  6. Etsija commented on Aug 26, 2025

    @Etsija

    Are there any updates to this? It is still totally blocking us from updating TypeScript post v5.9.2.

  7. christopher-caldwell commented on Sep 17, 2025

    @christopher-caldwell

    Just realised I was missing a peer depencency ts-morph. It worked after adding it!

    Thanks @claudioBarreira89, this fixed it for me.

  8. PEvgeniya commented on Oct 8, 2025

    @PEvgeniya

    Just realised I was missing a peer depencency ts-morph. It worked after adding it!

    For me worked only after update of ts-morph till latest version. Thanks!

  9. amcdnl commented on Nov 4, 2025

    @amcdnl

    Also hitting this - any chance the maintainer could update the repo to help others?

  10. The-Lone-Druid commented on Dec 9, 2025

    @The-Lone-Druid

    Hi @amcdnl have you tried installing ts-morph? I did npm install -D ts-morph and it solved the issue for me.

    Thanks to @claudioBarreira89
    #178 (comment)

  11. Rowan-Paul commented on Dec 23, 2025

    @Rowan-Paul

    I had this problem and updating ts-morph fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions