Error: Failed to collect page data for

Hi @feliprado! Welcome to the Vercel Community :smile:

Thanks for the detailed description. Let’s tackle this strange issue with some quick checks:

  1. Node.js Version: Ensure consistency with an .nvmrc file:
 echo "18.17.0" > .nvmrc  # Replace with your project's Node version

  1. Next.js Version: Try downgrading:
 npm install next@14.1.0npm install next@14.1.0

  1. Babel: Check for custom configs interfering with Next.js.
  2. TypeScript: Verify tsconfig.json compatibility with your Next.js version.
  3. ESLint: Temporarily disable to isolate the issue:
 mv .eslintrc.json .eslintrc.json.bakmv .eslintrc.json .eslintrc.json.bak

  1. Next.js Cache: Clear it:
 rm -rf .nextrm -rf .next

  1. Dependencies: Update all:
 npx npm-check-updates -u && npm installnpx npm-check-updates -u && npm install

  1. File Encoding: Ensure UTF-8 without BOM for all files.
  2. Environment Variables: Review, especially in API routes.
  3. Experimental Flag: Add to package.json scripts:
 "dev": "node --experimental-vm-modules node_modules/next/dist/bin/next dev""dev": "node --experimental-vm-modules node_modules/next/dist/bin/next dev"

(Do the same for ā€œbuildā€ and ā€œstartā€ scripts)

If these don’t work, try creating a minimal reproduction.

Good luck, and let us know how it goes!