**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
claudioBarreira89 commentedon Apr 8, 2025
Did you ever find a solution for this? I'm facing the same problem
vahidvdn commentedon Apr 8, 2025
@claudioBarreira89 Unfortunately not. I just used Orval. It just works fine.
claudioBarreira89 commentedon Apr 8, 2025
Just realised I was missing a peer depencency
ts-morph. It worked after adding it!vahidvdn commentedon Apr 8, 2025
Interesting! However, it's not mentioned anywhere, or at least I didn't see it
Etsija commentedon Aug 8, 2025
We tried adding
ts-morphas a peer dependency to our project, but it didn't help. This error prevents us from updating to TypeScript v5.9.2.Etsija commentedon Aug 26, 2025
Are there any updates to this? It is still totally blocking us from updating TypeScript post v5.9.2.
christopher-caldwell commentedon Sep 17, 2025
Thanks @claudioBarreira89, this fixed it for me.
PEvgeniya commentedon Oct 8, 2025
For me worked only after update of
ts-morphtill latest version. Thanks!amcdnl commentedon Nov 4, 2025
Also hitting this - any chance the maintainer could update the repo to help others?
The-Lone-Druid commentedon Dec 9, 2025
Hi @amcdnl have you tried installing
ts-morph? I didnpm install -D ts-morphand it solved the issue for me.Thanks to @claudioBarreira89
#178 (comment)
Rowan-Paul commentedon Dec 23, 2025
I had this problem and updating ts-morph fixed it.