#unhandledRejection: Error: NEXT_NOT_FOUND when using Redirect

4 messages · Page 1 of 1 (latest)

gusty folio
#

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

limber compassBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

gusty folio
#

I wonder if this is a an issue with 14.2.1

gusty folio
#

I have tried everything and still at a loss