-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: rewrite 404 in middleware (#1664)
- Loading branch information
1 parent
ecc47b3
commit 0d8e8a8
Showing
5 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
import { capturePosthogEvent } from "@fern-ui/ui"; | ||
import Error from "next/error"; | ||
import { ReactElement } from "react"; | ||
import { ReactElement, useEffect } from "react"; | ||
|
||
/** | ||
* This is required for Next.js to generate `_next/static/chunks/pages/404.js` | ||
* Which helps prevent a client-side error to be thrown when navigating to a non-existent page | ||
*/ | ||
export default function Page(): ReactElement { | ||
useEffect(() => { | ||
capturePosthogEvent("not_found"); | ||
}); | ||
|
||
return <Error statusCode={404} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters