Issue With Creating A Function Inside A Script R Nextjs

Issue With Creating A Function Inside A Script R Nextjs