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