return notFound() doesn't work in parallel routing #65215
-
I'm using next.js 14 with app router. This is my dynamic/paralel routing folder structure.
This is my /form/[id]/update/page.tsx
It all works as expected, but when i input an id that doesn't exist, it returns this error: Unhandled Runtime Error But I think it has nothing to do with the /form/@form/[id]/update/page.tsx that has this code:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@pavelbuchta Try calling it as import { Locale } from "@/i18n-config";
import { getFormById } from "@/lib/form";
import { getDictionary } from "@/lib/get-dictionary";
import { notFound } from "next/navigation";
import AdminHeader from "../../../_components/admin-header";
export default async function DiscoveryFormsPageCreate({
params,
}: {
params: { lang: Locale; id: string };
}) {
const dict = (await getDictionary(params.lang)).admin.form.update;
const form = await getFormById(params.id);
if (!form) {
notFound();
}
return (
<AdminHeader headline={dict.headline} subheadline={dict.subheadline} />
);
} |
Beta Was this translation helpful? Give feedback.
-
I found the solution. I haven't configured a not-found.tsx page. Creating a not-found page solved the problem. |
Beta Was this translation helpful? Give feedback.
I found the solution. I haven't configured a not-found.tsx page. Creating a not-found page solved the problem.