-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
feat(nextjs): Add instructions for custom _error page #496
Conversation
|
fs | ||
.readFileSync( | ||
path.join(process.cwd(), ...pagesLocation, underscoreErrorPageFile), | ||
'utf8', | ||
) | ||
.includes('getInitialProps') |
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.
l: This could lead to a false positive for commented out code but I guess it's fine
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.
I saw this more as a heuristic of "are people aware of getInitialProps and what it does". If they have it commented out somewhere, they're likely aware of it's existence and can google on how to use it. If it's not there at all people might not know it and then we need to have a little bit more hand-holding.
console.log( | ||
getFullUnderscoreErrorCopyPasteSnippet( | ||
underscoreErrorPageFile === '_error.ts' || | ||
underscoreErrorPageFile === '_error.tsx', | ||
), | ||
); |
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.
same question here
); | ||
|
||
// eslint-disable-next-line no-console | ||
console.log(getSimpleUnderscoreErrorCopyPasteSnippet()); |
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.
l/m: Should we use the copy/paste instruction helper function from clack-utils.ts
instead?
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.
Oh, I forgot this existed!
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.
Now that I look at it, I think I'd like to have a slightly different message than in the helper. Are you okay with me leaving it like this or should I make adjustments?
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.
Sure, sounds good. Just wanted to make sure we use it it's applicable.
Following getsentry/sentry-docs#8479 we want the wizard to provide you instructions on how to instrument React rendering errors.