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

fix: redirect 500 error #1696

Merged
merged 1 commit into from
Jul 26, 2023
Merged

fix: redirect 500 error #1696

merged 1 commit into from
Jul 26, 2023

Conversation

lichenqin1
Copy link
Contributor

Description

Fixes #1580

Remove redirect for 500 error and use the custom error page to return 500 error. It only works in production due to the design of Next.js, not sure if there is a better way.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Screenshots

Before After
1 2

How Has This Been Tested?

  • Cypress integration
  • Cypress component tests
  • Jest unit tests

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Copy link
Collaborator

@dadiorchen dadiorchen left a comment

Choose a reason for hiding this comment

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

@lichenqin1 I wait for this PR for months :D thank you! please remove the comment above and I will merge it.

Comment on lines 233 to 236
// redirect: {
// destination: '/500',
// permanent: false,
// },
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think commenting out code is not a good practice, to keep the code clean, let's simply remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the commented code, thanks for the suggestion.

@dadiorchen dadiorchen merged commit 0b44b85 into Greenstand:main Jul 26, 2023
3 checks passed
@dadiorchen
Copy link
Collaborator

@lichenqin1 thank you!

@github-actions
Copy link

🎉 This PR is included in version 2.6.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set up next.js to do not redirect to /500 when encountering 500 error
2 participants