Next.js Discord

Discord Forum

unhandledRejection: Error: NEXT_NOT_FOUND when using Redirect

Unanswered
Thai posted this in #help-forum
Open in Discord
ThaiOP
I am getting an error of :

unhandledRejection: Error: NEXT_NOT_FOUND


When I do a redirect in a server action.

The server action is as simple as this:

'use server'

import { cookies } from "next/headers"
import { redirect } from "next/navigation"

export async function AmountAction(formData: FormData) {

    return redirect(`/${formData.get('formSlug')}/contact-info`);
    


The browser does redirect to that page but it throws an error of:
Unhandled Runtime Error
NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.


If I refresh the page at that point it refreshes correctly, it is just not loading on redirect

3 Replies

ThaiOP
I wonder if this is a an issue with 14.2.1
ThaiOP
I have tried everything and still at a loss
ThaiOP
well I have rolled back to 14.1.1 and still no luck, what would cause this