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

feat(nextjs): Add instructions for custom _error page #496

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

lforst
Copy link
Member

@lforst lforst commented Nov 13, 2023

Following getsentry/sentry-docs#8479 we want the wizard to provide you instructions on how to instrument React rendering errors.

@lforst lforst requested a review from Lms24 November 13, 2023 15:26
Copy link

github-actions bot commented Nov 13, 2023

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 964ea87

Comment on lines +130 to +135
fs
.readFileSync(
path.join(process.cwd(), ...pagesLocation, underscoreErrorPageFile),
'utf8',
)
.includes('getInitialProps')
Copy link
Member

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

Copy link
Member Author

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.

Comment on lines +169 to +174
console.log(
getFullUnderscoreErrorCopyPasteSnippet(
underscoreErrorPageFile === '_error.ts' ||
underscoreErrorPageFile === '_error.tsx',
),
);
Copy link
Member

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());
Copy link
Member

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?

Copy link
Member Author

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!

Copy link
Member Author

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?

Copy link
Member

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.

@lforst lforst merged commit 437a55b into master Nov 14, 2023
10 checks passed
@lforst lforst deleted the lforst-nextjs-error-page branch November 14, 2023 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants