aws-amplify / aws-amplify/amplify-hosting

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

Open
#3,989 6 comments 5 reactions 0 assignees View on GitHub
feature-request
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [x] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-hosting/blob/master/FAQ.md).
- [x] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-hosting/issues?q=is%3Aissue+).
- [x] I have removed any sensitive information from my code snippets and submission.

### Amplify Hosting feature

Monorepo, Build settings, Deployments, Frontend builds

### Is your feature request related to a problem? Please describe:

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 and deployed 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:

version: 1
applications:

frontend:
phases:
preBuild:
commands:
nvm use 22
yarn install
build:
commands:
yarn run build --filter=omnipulse
artifacts:
baseDirectory: apps/appname/.next
files:
'/'
cache:
paths:
node_modules//

.next/cache/
/*
apps/appname/node_modules//*
apps/appname/.next/cache/
/*

![Image](https://github.com/user-attachments/assets/e70605dd-ac1d-42c4-806f-4c045a8624d8)

buildPath: /
appRoot: apps/appname

### Describe how you'd like this feature to work

when i click on link it should be open website

Contributor guide

Open the contributing guide

Research direction

Start with the CloudWatch error and the provided Amplify build settings, focusing on the Turborepo application path, build command, and Next.js deployment artifacts. Verify the deployed application entry point and reproduce the failure from the generated deployment link. Done means the link opens the website without a 500 error or missing-module failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, next.js, node.js
Domain
build-system, cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.