aws amplify production error for next js “An error occurred in the Server Components render”

this is the function in the “use client” file

const handleOrderTransaction = (index: number) => {
    const transaction = transactions[index]

    if (!form.Name || !form.PhoneNumber) {
        return toast.error("חובה למלא את פרטי המזמין!")
    }
    if (ship && !form.city || !form.customerName || !form.homeNumber || !form.street) {
        return toast.error("חובה למלא פרטי משלוח!")
    }

    if (ship && !form.customerName || !form.shipDate) {
        return toast.error("חובה למלא את פרטי המקבל!")
    }

    if (!ship && !form.storeId) {
        return toast.error("חובה לבחור נקודת איסוף!")
    }

    if (transaction && transaction.type === OrderTransactionPayment.NOT_PAY && !transaction.payDate) {
        return toast.error("חובה להוסיף תאריך לתשלום!")
    }

    let formOrder = {
        ...form,
        storeId: ship ? "" : form.storeId,
        customerBusinessName: form.customerBusiness ? form.customerBusinessName : ""
    }

    if(transactions.every(i => i.paid)) {
        return router.push(`/orders/${form?.id}`)
    }

    if (!transaction) {
        return toast.promise(createOrderZeroAmount(productsSend, formOrder, discounts, totalAmount), {
            loading: "מעביר להזמנה...",
            success: (data) => {
                onGetOrders()
                router.push(`/orders/${data?.id}`)
                return "תשלום בוצע בהצלחה!"
            },
            error: (err) => err.message
        })
    }

    toast.promise(newOrderWithTransaction(productsSend, formOrder, discounts, totalAmount, transaction , ship , form.id), {
        loading: "מחייב תשלום...",
        success: (data) => {
            setTransactions(prev => prev.map((tran, i) => i === index ?
                ({
                    ...tran,
                    paid: transaction.type === OrderTransactionPayment.CHECKOUT ? true : data.paid!,
                    card4Digits: data.card4Digits!,
                    receiptCopy: data.receiptCopy ? data.receiptCopy : "",
                    receiptOriginal: data.receiptOriginal ? data.receiptOriginal : "",
                })
                : tran))
            setForm(prev => ({...prev, id: data.orderId}))
            onGetOrders()
            return "תשלום בוצע בהצלחה!"
        },
        error: (err) => err.message
    })
}

and this in the file fetch-orders.ts with “use-server”

export const newOrderWithTransaction = async (products: OrderProductNew[], customer: OrderCustomer , discounts : OrderProductNew[] , amount : number , transaction : OrderTransactionType , ship : boolean , orderId ?: number) => {
    try {
        const session: Session | null = await getServerSession(authOptions)

        if (!session?.user) {
            throw new Error("אין לך הרשאה לבצע פעולה זו!");
        }

        const client = {
            name: customer.Name,
            email: customer.Email || process.env.DEFAULT_MAIL!,
            address: `${customer.street} ${customer.homeNumber}`,
            city: customer.city,
            phone: customer.PhoneNumber,
        }

        const incomeProduct = products.map(item => ({
            description : item.Name,
            quantity : item.Quantity,
            price : item.Amount,
            currency : "ILS",
            currencyRate : 1,
            itemId : item.productId?.toString(),
            vatType : 1
        })) as IncomeDocumentType[];

        const discountAmount = discounts.reduce((previousValue , currentValue) => previousValue + currentValue.Amount,0)

        let income = [...incomeProduct]

        if(ship) {
            const allShips = await getAllShip()
            const findShip = allShips.find(i => i.city === customer.city)
            if(findShip) {
                income.push({
                    description : "עלות משלוח",
                    quantity : 1,
                    price : parseFloat(findShip.amount),
                    currency : "ILS",
                    currencyRate : 1,
                    vatType : 1
                })
            }
        }

        if(orderId) {
            return newOrderTransaction(orderId , transaction , client , income , amount , discountAmount)
        }

        const couponCode = discounts.find(i => i.type === "coupon")?.Code
        const pointsUsage = discounts.find(i => i.type === "points")?.Amount
        const giftCode = discounts.find((i) => i.type === "giftCart");

        const data = {
            ...customer,
            status : transaction.amount === amount ? OrderStatus.PAID : OrderStatus.PENDING,
            Email: customer.Email.toLowerCase(),
            couponCode : couponCode!!,
            pointsUsage : pointsUsage!!,
            giftCode: giftCode!!?.Code,
            giftUsage : giftCode!!?.Amount,
            homeNumber : customer?.homeNumber?.toString(),
            homeFloor : customer?.homeFloor?.toString(),
            amount
        } as any

        const order = await db.order.create({
            data
        })

        await Promise.all(
            products.map(async (product) => {

                await db.orderProduct.create({
                    data: {
                        productId : product?.productId!,
                        Name : product.Name,
                        Amount : product.Amount,
                        Quantity : product.Quantity,
                        Image : product.Image!,
                        orderId: order.id
                    },
                    include: {
                        product: true
                    }
                })
            })
        )

        return newOrderTransaction(order.id , transaction , client , income , amount , discountAmount)
    } catch (err) {
        throw err
    }
}
export const newOrderTransaction = async (orderId : number , transaction : OrderTransactionType , client : InvoiceCustomer , income : IncomeDocumentType[] , amount : number , discount : number) => {
    try {

        const trans = {
            CardNumber : transaction.cardNumber , CVV : transaction.cvv , ExpDate_MMYY : transaction.expiryDate?.replace("/" , "") , TransactionSum : transaction.amount , NumberOfPayments : transaction.numberOfPayments
        }

        let data = {
            type : transaction.type,
            amount : transaction.amount,
            orderId,
            payDate : transaction.payDate,
            bankAcountNumber : transaction.bankAcountNumber,
            bankBranch : transaction.bankBranch,
            bankName : transaction.bankName,
            referenceId: parseInt(transaction.referenceId!),
            chequeNumNumber: transaction.referenceId,
            accountPayNumber : transaction.accountPayNumber
        } as any

        if(transaction.type === OrderTransactionPayment.CREDIT_CARD) {
            const resp = await fetch(`${process.env.NEXTAUTH_URL!}/api/create-order-transaction`, {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json',
                },
                body: JSON.stringify(trans),
            })


            let response = await resp.json()

            if (response.HasError) {
                throw new Error(response.ReturnMessage)
            }

            data = {
                ...data,
                cardName : response.CardName,
                card4Digits : parseInt(response.Card4Digits),
                expiryDate : response.ExpDate_MMYY,
                referenceId : response.ReferenceNumber.toString(),
                token : response.Token,
                numberOfPayments : transaction.numberOfPayments,
                paid : true
            } as any
        }

        const newTransaction = await db.orderTransaction.create({
            data
        })

        if(transaction.type === OrderTransactionPayment.CHECKOUT) {
            return newTransaction
        }

        let receipt : any

        if(transaction.type === OrderTransactionPayment.NOT_PAY || transaction.type === OrderTransactionPayment.DELIVERY_PAY) {
            if(transaction.payDate) {
                await newNotification({ transactionId : newTransaction.id , createdAt : transaction.payDate , type : NotificationType.TRANSACTION})
            }
            receipt = await createInvoice(newTransaction.id , client , income)
        } else  {
            if(transaction.amount === amount ) {
                await createInvoiceReceipt(newTransaction.orderId , client , income , [client.email] , discount)
            }
            receipt = await createReceipt(newTransaction , client)
        }

        return db.orderTransaction.update({
            where : {id : newTransaction.id},
            data : {
                receiptNumber : receipt.receiptNumber,
                receiptOriginal : receipt.receiptOriginal,
                receiptCopy : receipt.receiptCopy,
                paid : transaction.type !== OrderTransactionPayment.NOT_PAY
            }
        })
    } catch (err) {
        throw err
    }
}

why i in the development in local its work fine but after deploy to amplify aws i get this error
An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật