You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some errors during the output stage are supressed even with verbose and noSilentErrors options set to true, failing silently not giving any clue as to what the problem is (sometimes giving no clue that there is a problem unless you delete the old output, refresh and see no new output is generated).
An easy way to replicate this is to try to output to a directory (e.g. './types/) with configuration that will want to output to a single file. Instead of throwing a relevant error, this fails silently during the output phase (I imagine a lot of other file system errors (e.g. permissions errors?) will get suppressed in a similar way?).
With npm run codegen the verbose console output will look like this, appearing to have succeeded:
Passing --verbose to npm itself like npm run --verbose codegen adds npm verb code 1 and using PNPM adds ELIFECYCLE Command failed with exit code 1. but nothing indicates what the supressed error is.
import{CodegenConfig}from'@graphql-codegen/cli';constconfig: CodegenConfig={schema: 'schema.graphql',documents: 'document.graphql',generates: {// This config should output to a file (some other configs may output to a folder).// Instead of giving an error message, `npm run codegen --verbose` fails silently.'./types/': {plugins: ['typescript','typescript-operations']},},verbose: true,noSilentErrors: true,};exportdefaultconfig;
Additional context
Related non-dupe suppressed error issues:
There's a noSilentErrors option that it false by default (?!?) but it makes no difference in this case
The text was updated successfully, but these errors were encountered:
AlanSl
changed the title
Some output errors are hidden and fail silently even with "verbose" on
Some output errors are hidden and fail silently even with "verbose" and "noSilentErrors" on
Nov 7, 2024
Which packages are impacted by your issue?
@graphql-codegen/cli
Describe the bug
Some errors during the output stage are supressed even with
verbose
andnoSilentErrors
options set to true, failing silently not giving any clue as to what the problem is (sometimes giving no clue that there is a problem unless you delete the old output, refresh and see no new output is generated).An easy way to replicate this is to try to output to a directory (e.g.
'./types/
) with configuration that will want to output to a single file. Instead of throwing a relevant error, this fails silently during the output phase (I imagine a lot of other file system errors (e.g. permissions errors?) will get suppressed in a similar way?).With
npm run codegen
the verbose console output will look like this, appearing to have succeeded:Passing
--verbose
to npm itself likenpm run --verbose codegen
addsnpm verb code 1
and using PNPM addsELIFECYCLE Command failed with exit code 1.
but nothing indicates what the supressed error is.Your Example Website or App
https://stackblitz.com/edit/github-hceazx?file=types.ts
Steps to Reproduce the Bug or Issue
Run
npm run codegen
Expected behavior
It should give a relevant error message, in this case something like "
./types/
is not a file" or just output the actual system error in the console.Screenshots or Videos
No response
Platform
graphql
version: 16.9.0@graphql-codegen/*
version(s): @graphql-codegen/cli 5.0.3Codegen Config File
Additional context
Related non-dupe suppressed error issues:
noSilentErrors
option that it false by default (?!?) but it makes no difference in this caseignoreNoDocuments
, but I'm not using thatThe text was updated successfully, but these errors were encountered: