redwoodjs / redwood

The App Framework for Startups
https://redwoodjs.com
MIT License
17.28k stars 991 forks source link

Errors from redwood's dependencies are hard to debug #3456

Open deibeljc opened 3 years ago

deibeljc commented 3 years ago

I came across a small issue last night where my SUPABASE_JWT_SECRET was copied and pasted wrong which resulted in this error in my logs

ERROR [2021-09-30 03:50:05.952 +0000] (graphql-server): Error building context. 
Error: Exception in getAuthenticationContext: invalid signature

This gave me little to no clues on what was actually going on, which was the jsonwebtoken validate function was blowing up since my secret was wrong!

I would really like to surface more metadata in the logs for when stuff blows up. It took me awhile to figure out my issue and I had to dig in and modify redwood source code to spit out what the actual issue was (try catch on the method named in the error above in redwood/api, kudos for having that!). If I had a stack trace I would have fixed it in minutes rather than an hour.

TLDR: GIB STACKTRACE PLS!

dthyresson commented 3 years ago

Hi @deibeljc prior to 0.37 errors that happened during the context building or getCurrentUser were getting swallowed up, so no output. This has been addressed, but I can see your point here that without a stack trace it can be hard to diagnose.

The message "invalid signature" comes from the JWT package.

Perhaps we:

thedavidprice commented 3 years ago

@aldonline zOMG we are so excited for the VS Code Redwood Extension with DEBUGGING.

Pretty please? Who do I need to talk to 😉

aggmoulik commented 3 years ago

Hey @thedavidprice @aldonline I would love to work on the VSCode Extension for Redwood, Can I know how can I contribute ?