Skip to content

Commit

Permalink
added error page
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Oct 24, 2023
1 parent c6335a4 commit ccffd41
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions app/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"use client";

const Error = ({error, reset}: { error: Error; reset: () => void }) => {
console.error(error.message);
return (
<div className="centered my-50">
<h2>Something went wrong!</h2>
Apologies, an error occurred when attempting to preset the page you are attempting to view. Please try a different
path.
<button onClick={() => reset()}>Try again</button>
</div>
)
}
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const nextConfig = {
},
async redirects() {
const devRedirects = [];
if (process.env.DEV === 'true') {
if (process.env.NODE_ENV === 'development') {
devRedirects.push({
source: '/style-guide',
destination: 'http://localhost:6006',
Expand Down

1 comment on commit ccffd41

@vercel
Copy link

@vercel vercel bot commented on ccffd41 Oct 24, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.