-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicated error message #7546
Comments
If I switch this to
But I guess the fix isn't as easy as that. You probably have a good reason for stoping early 🙂 |
Hi @Tobbe, First, sorry for the enormous delay in answering your issue. For your custom scripts, the duplicated errors come from your script implementation that does not provide a "catch" handler to cli.generate(codegenConfig, true).then(
(data) => {
console.log("data", data);
},
() => Promise.resolve() // not providing this callback will trigger a nodejs "triggerUncaughtException"
); |
@Tobbe the CLI duplicated error messages bug is fixed in |
Thanks @charlypoly! We've since moved to using |
Describe the bug
In RedwoodJS we generate types programatically. When there are no files with gql stuff to parse we get a duplicated error message:
It would look much better for our users if you only output the error message once.
To Reproduce
I tried to reproduce the error message in codesandbox, but I couldn't get it to look exactly the same, I get much more output there. But I hope it's close enough to be useful for you. This is what I get when I run
node script.js
https://codesandbox.io/s/agitated-heyrovsky-2yriny?file=/script.js
See codesandbox link
See codesandbox link
codegen.yml
config file:(Also see codesandbox link)
Expected behavior
I expect the error to only show once.
Environment:
@graphql-codegen/cli
: 2.6.1Additional context
Issue and draft PR on our side:
redwoodjs/redwood#4393
redwoodjs/redwood#4491
The text was updated successfully, but these errors were encountered: