Issue: Deploying Turborepo Monorepo with Next.js 15 to AWS Amplify

I’m currently working on deploying a Turborepo-based monorepo to AWS Amplify, and I’m running into some issues. My setup includes Next.js 15 in the monorepo structure, and the Amplify build successful generated but when i click on link fails with 500 error Here are the key issues I’m facing: logs list in cloud watch node:internal/modules/cjs/loader:1228 2025-01-20T10:10:05.164Z Error: Cannot find module ‘next/dist/server/lib/start-server.js’ here is build settings file node version 22 version: 1 applications:

  • frontend: phases: preBuild: commands:
    • yarn install # Install dependencies at the root (main) level build: commands:
      • cd apps/obenan-dashboard # Navigate to the inner folder
        • echo “VITE_GOOGLE_LOCATION_API_KEY=$VITE_GOOGLE_LOCATION_API_KEY” > .env
          • echo “VITE_BASE_URL=$VITE_BASE_URL” > .env
            • yarn build # Run the build command in the app folderartifacts: baseDirectory: apps/obenan-dashboard/dist # Specify the dist directory inside the dashboard app files:
        • "**/* "cache: paths:
        • node_modules/**/*appRoot: .