-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Fix up error message argument wrapping and Error page styling #11195
Conversation
Error page styling
🦋 Changeset detectedLatest commit: a16cca9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
✅ Deploy Preview for apollo-client-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
I noticed that someone shared an error link in the form
https://go.apollo.dev/c/err#%7B%22version%22%3A%223.8.0-rc.2%22%2C%22message%22%3A12%2C%22args%22%3A%5B%5D%7D
which leads to this error page:
I could reproduce a code path that didn't serialize the args correctly.
This PR changes a few things:
invariant.log
etc., error arguments are now serialized correctly in the link to the error pagelineHeight: "normal", whiteSpace: "pre-wrap"
The generated link now looks like
https://go.apollo.dev/c/err#%7B%22version%22%3A%223.8.3%22%2C%22message%22%3A12%2C%22args%22%3A%5B%22fields%22%2C%22User%22%2C%22%22%2C%22User.fields%22%2C%22%5B%5Cn%20%20%7B%5Cn%20%20%20%20%5C%22foo%5C%22%3A%20%5C%22bar%5C%22%5Cn%20%20%7D%2C%5Cn%20%20%7B%5Cn%20%20%20%20%5C%22foo%5C%22%3A%20%5C%22baz%5C%22%5Cn%20%20%7D%5Cn%5D%22%2C%22%5B%5Cn%20%20%7B%5Cn%20%20%20%20%5C%22foo%5C%22%3A%20%5C%22bar%5C%22%5Cn%20%20%7D%5Cn%5D%22%5D%7D
And the rendering now looks like this:
This can be reproduced e.g. using this code snippet:
Checklist: