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

docs(nextjs): Update Next.js GlobalError prop type #10425

Merged
merged 2 commits into from
Jun 19, 2024
Merged

Conversation

s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Jun 18, 2024

DESCRIBE YOUR PR

Updates the Next.js snippet to not use type casting anymore
related to getsentry/sentry-wizard#592

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • None: Not urgent, can wait up to 1 week+

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

Copy link

vercel bot commented Jun 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 18, 2024 0:06am

Copy link

codecov bot commented Jun 18, 2024

Bundle Report

Changes will decrease total bundle size by 14 bytes ⬇️

Bundle name Size Change
sentry-docs-server 7.55MB 3 bytes ⬇️
sentry-docs-edge-server 478.98kB 3 bytes ⬇️
sentry-docs-client 6.21MB 8 bytes ⬇️

useEffect(() => {
Sentry.captureException(error);
}, [error]);

return (
<html>
<body>
{/* This is the default Next.js error component but it doesn't allow omitting the statusCode property yet. */}
<NextError statusCode={undefined as any} />
{/* Passing `0` as `statusCode` as the type has to be a number, but we do not get a status code here. */}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{/* Passing `0` as `statusCode` as the type has to be a number, but we do not get a status code here. */}
{/* `NextError` is the default Next.js error page component. Its type
definition requires a `statusCode` prop, however, since the App Router
does not expose status codes for errors, we simply pass 0 to render a
generic error message.*/}

I would put the same text in the wizard PR.

Copy link
Contributor

@vivianyentran vivianyentran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for updating!

@lforst lforst merged commit 33fc78c into master Jun 19, 2024
6 checks passed
@lforst lforst deleted the sig/nextjs-types branch June 19, 2024 11:25
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants