Skip to content
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

[RFC]: Show stack trace of errors in dev server console #5853

Closed
1 task
Philzen opened this issue Jun 29, 2022 · 3 comments
Closed
1 task

[RFC]: Show stack trace of errors in dev server console #5853

Philzen opened this issue Jun 29, 2022 · 3 comments
Assignees

Comments

@Philzen
Copy link
Contributor

Philzen commented Jun 29, 2022

Summary

Enable error stack trace visibility in the dev console for development (and potentially in logs for production).

Motivation

When devs make a coding mistake in a directive, the only information given is the error message, both in graphQL playground

grafik

and the terminal output

grafik

Impossible to tell in which file or even line of code the error happened with that information. Because i'd just refactored a transformer directive the day before i had a lucky hunch this error was thrown there because resolvedValue i was trying to access was already null for a given query.

Hunches are good and sometimes helpful – but i'd argue that a good stack trace is much more helpful in the first place 😉

Detailed proposal

This is about the API side and shouldn't be a breaking change of any sorts.

For starters, root cause visibility needs to be the default in development env. I'm agnostic about how this is configured in production, but i guess it should fall in the lines of current logging configuration.

Are you interested in working on this?

  • I'm interested in working on this
@redwoodjs-bot redwoodjs-bot bot moved this to Triage in Main Jun 29, 2022
@redwoodjs-bot redwoodjs-bot bot added this to Main Jun 29, 2022
@Philzen Philzen changed the title [RFC]: Enable debugging of directives by showing stack trace in dev server console [RFC]: Show stack trace of errors in dev server console Jun 29, 2022
@Philzen
Copy link
Contributor Author

Philzen commented Jun 29, 2022

OK, i'm confused now:

My main project i'm working on is on 1.5.1, but i have a sandbox project based on 2.0.0 – and in the the latter i get full-on stack traces, preceded by a 🚨 GraphQLError Info object.

@Philzen
Copy link
Contributor Author

Philzen commented Jun 29, 2022

Confusion solved: #5704 which was shipped with 2.0.0 fixed this.

Guess it's high time to upgrade.

@Philzen Philzen closed this as completed Jun 29, 2022
Repository owner moved this from Triage to Done in Main Jun 29, 2022
@dthyresson
Copy link
Contributor

Sorry for the confusion - we got that regression fix in during the last release. Glad it’s working for you.

@redwoodjs-bot redwoodjs-bot bot moved this from Done to Archived in Main Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Archived
Development

No branches or pull requests

2 participants