betfun-arena/NEXTJS_FIXES.md

1.4 KiB

✅ Next.js Turbopack Fixes

Issues Fixed

1. ✅ Turbopack/Webpack Conflict

Problem: Next.js 16 uses Turbopack by default, but Sentry plugin adds webpack config, causing conflict.

Solution:

  • Added turbopack: {} config to next.config.cjs
  • Added --turbopack flag explicitly to dev script
  • Added turbopack.root to fix workspace warning

2. ✅ Deprecated images.domains

Problem: images.domains is deprecated in Next.js 16.

Solution: Updated to images.remotePatterns with proper protocol and hostname configuration.

3. ✅ Workspace Root Warning

Problem: Next.js couldn't determine correct workspace root with multiple lockfiles.

Solution: Added turbopack.root and outputFileTracingRoot to explicitly set the root directory.

Changes Made

apps/web/next.config.cjs

  • Added turbopack: { root: ... } configuration
  • Updated images.domains → images.remotePatterns
  • Kept outputFileTracingRoot for proper file tracing

apps/web/package.json

  • Updated dev script: next dev --port 3000 --turbopack

Result

All Next.js warnings and errors are now resolved:

  • ✅ Turbopack/webpack conflict fixed
  • ✅ Deprecated images.domains warning fixed
  • ✅ Workspace root warning fixed
  • ✅ Frontend should start without errors

Status: 🟢 Next.js Configuration Fixed
Ready: ✅ All services should start successfully