diff --git a/src/app/(checkout)/not-found.tsx b/src/app/(checkout)/not-found.tsx
new file mode 100644
index 000000000..7ad35eef5
--- /dev/null
+++ b/src/app/(checkout)/not-found.tsx
@@ -0,0 +1,21 @@
+import { Metadata } from "next"
+import Link from "next/link"
+
+export const metadata: Metadata = {
+ title: "404",
+ description: "Something went wrong",
+}
+
+export default function NotFound() {
+ return (
+
+
Page not found
+
+ The page you tried to access does not exist.
+
+
+ Go to frontpage
+
+
+ )
+}
diff --git a/src/app/(main)/not-found.tsx b/src/app/(main)/not-found.tsx
new file mode 100644
index 000000000..7ad35eef5
--- /dev/null
+++ b/src/app/(main)/not-found.tsx
@@ -0,0 +1,21 @@
+import { Metadata } from "next"
+import Link from "next/link"
+
+export const metadata: Metadata = {
+ title: "404",
+ description: "Something went wrong",
+}
+
+export default function NotFound() {
+ return (
+
+
Page not found
+
+ The page you tried to access does not exist.
+
+
+ Go to frontpage
+
+
+ )
+}
diff --git a/src/modules/categories/templates/index.tsx b/src/modules/categories/templates/index.tsx
index acc4549ba..9b7c8d1c6 100644
--- a/src/modules/categories/templates/index.tsx
+++ b/src/modules/categories/templates/index.tsx
@@ -15,6 +15,7 @@ import React, { useEffect } from "react"
import { useInView } from "react-intersection-observer"
import Link from "next/link"
import UnderlineLink from "@modules/common/components/underline-link"
+import { notFound } from "next/navigation"
type CategoryTemplateProps = {
categories: ProductCategoryWithChildren[]
@@ -27,6 +28,8 @@ const CategoryTemplate: React.FC = ({ categories }) => {
const category = categories[categories.length - 1]
const parents = categories.slice(0, categories.length - 1)
+ if (!category) notFound()
+
const {
data: infiniteData,
hasNextPage,