-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: Improve server error logging #13990
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
base: main
Are you sure you want to change the base?
Conversation
|
Please tell me if I should delete the changes from the playground directory 🙂 |
Can you please update the PR title to more specifically describe how error logging is being improved? |
@benmccann yes, of course, sorry 😅 I just added some extra context. |
8ba9932
to
96cc344
Compare
f387b9d
to
8ba9932
Compare
8ba9932
to
f878bdb
Compare
Partly resolves #13862.
This PR sanitizes stack trace for server errors by finding the last occurrence of "+page.", "+server.", or "+layout." in the stack trace, and removing everything that comes after that line.
Error logs on the server before:
After:
I also colored the top line red, because why not:
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
As for the tests, I couldn't find a way to write Playwrite tests for the server logs. I dug up some similar tests, but they only test the error object itself, not the server log messages.
It seems like you can't easily listen on the server logs in Playwright, so if we really need it, I'd have to intercept the
console.log(...)
statements with something like this:pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits