From c3cf1445dc38b2365030606e2166d3582b261c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=ADcholas=20Oliveira?= Date: Tue, 25 Jun 2024 14:24:11 -0300 Subject: [PATCH] feat(data-fetching): issue a not-found if no redirect is found --- packages/next/src/rsc/data/handleFetchError.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/next/src/rsc/data/handleFetchError.ts b/packages/next/src/rsc/data/handleFetchError.ts index e7bc723e2..4299b5e9a 100644 --- a/packages/next/src/rsc/data/handleFetchError.ts +++ b/packages/next/src/rsc/data/handleFetchError.ts @@ -1,5 +1,5 @@ import { LOGTYPE, fetchRedirect, getHeadstartWPConfig, log } from '@headstartwp/core'; -import { permanentRedirect, redirect } from 'next/navigation'; +import { notFound, permanentRedirect, redirect } from 'next/navigation'; export async function handleFetchError(error: Error, path = '') { const { redirectStrategy, sourceUrl, debug } = getHeadstartWPConfig(); @@ -20,5 +20,7 @@ export async function handleFetchError(error: Error, path = '') { } } } + + notFound(); } }