current version nextjs v15.2.5 react v19.1.0
Recently, one of our projects started to use the new fluid calculation function of vercel, but in some ISR pages, the following problem occurs, and we are still vercel pro members, we really don't understand why this bug occurs, and hope that the official assistance in troubleshooting!
⨯ [Error: EMFILE: too many open files, open '/var/task/node_modules/@tanstack/react-query/build/modern/useIsFetching.js'] { errno: -24, code: 'EMFILE', syscall: 'open', path: '' path: '/var/task/node_modules/@tanstack/react-query/build/modern/useIsFetching.js'}I hope the official can assist us to troubleshoot, thanks!Below is a sample code example:
import dynamic from 'next/dynamic'import { useRouter } from 'next/router'import PaymentsLayout from '@/components/layout/payments'import PaymentLink from '@/components/dapp/pay/link'import { bigintFactory } from '@/lib/db/prisma/utils'import prisma from '@/lib/db/prisma'import { useUserData } from '@/lib/hooks'
export async function getStaticPaths() { return { paths: [], fallback: 'blocking', }}
export async function getStaticProps(context) { const { id } = context.params
try { let data = await prisma.payee.findUnique({ where: { id }, })
if (!data) { return { notFound: true } }
data = bigintFactory(data)
return { props: { data }, revalidate: 10, } } catch (error) { console.error('Error fetching payment link:', error) return { notFound: true, // props: { error: 'Failed to load payment link ˙◠˙' }, } }}
export default function PayLinkFormId({ data, error }) { const router = useRouter() const user = useUserData()
if (user?.id && data?.uuid && user?.id !== data?.uuid) { router.replace('/pay') return null }
return ( <PaymentsLayout navTitle="Update Payment Link"> <PaymentLink data={data} customClass="pt-8" /> </PaymentsLayout> )}