Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🐛 Fix not found page not rendering properly (#1308)

Luke Vella2ab67d819c25
diff --git a/apps/web/src/app/[locale]/[...rest]/page.tsx b/apps/web/src/app/[locale]/[...notFound]/page.tsx
similarity index 100%
rename from apps/web/src/app/[locale]/[...rest]/page.tsx
rename to apps/web/src/app/[locale]/[...notFound]/page.tsx
diff --git a/apps/web/src/app/[locale]/invite/[urlId]/layout.tsx b/apps/web/src/app/[locale]/invite/[urlId]/layout.tsx
index 9c0f29eb2..c456865c0 100644
--- a/apps/web/src/app/[locale]/invite/[urlId]/layout.tsx
+++ b/apps/web/src/app/[locale]/invite/[urlId]/layout.tsx
@@ -1,5 +1,5 @@
"use client";
-import { useParams, useSearchParams } from "next/navigation";
+import { notFound, useParams, useSearchParams } from "next/navigation";
import React from "react";
import { LegacyPollContextProvider } from "@/components/poll/poll-context-provider";
@@ -35,7 +35,7 @@ const Prefetch = ({ children }: React.PropsWithChildren) => {
const comments = trpc.polls.comments.list.useQuery({ pollId: urlId });
if (error?.data?.code === "NOT_FOUND") {
- return <div>Not found</div>;
+ notFound();
}
if (!poll || !participants || !comments.isFetched) {
return <Loader />;
diff --git a/apps/web/src/app/[locale]/invite/[urlId]/page.tsx b/apps/web/src/app/[locale]/invite/[urlId]/page.tsx
index d57b7bcc2..05ebab740 100644
--- a/apps/web/src/app/[locale]/invite/[urlId]/page.tsx
+++ b/apps/web/src/app/[locale]/invite/[urlId]/page.tsx
@@ -1,6 +1,5 @@
import { prisma } from "@rallly/database";
import { Metadata } from "next";
-import { notFound } from "next/navigation";
import { InvitePage } from "@/app/[locale]/invite/[urlId]/invite-page";
import { getTranslation } from "@/app/i18n";
@@ -36,7 +35,7 @@ export async function generateMetadata({
const { t } = await getTranslation(locale);
if (!poll) {
- return notFound();
+ return null;
}
const { title, id, user } = poll;