apollo-tooling icon indicating copy to clipboard operation
apollo-tooling copied to clipboard

[codegen] Maximum call stack size exceeded while generating type files (typescript)

Open cglacet opened this issue 3 years ago • 2 comments

I'm using apollo's codegen for a few months but recently got this error:

$ ❯ apollo client:codegen --target=typescript --watch --tagName=gql --addTypename --globalTypesFile=types/graphql-global-types.ts types
  ✔ Loading Apollo Project
  ✔ Generating query files with 'typescript' target - wrote 47 files
    RangeError: Maximum call stack size exceeded

Any idea where that could come from? Or how to get more information (debug logs)?

Thanks

cglacet avatar May 18 '21 16:05 cglacet

I found that the following fixed my issue (even though we don't have any graphql query in our .ts files):

module.exports = {
    client: {
+        includes: ['**/*.tsx'],
-        includes: ['**/*.ts', '**/*.tsx'],
    },
};

cglacet avatar May 18 '21 17:05 cglacet

Just for curiosity, what file is this?

rmrantunes avatar Jun 11 '22 13:06 rmrantunes