Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
ahtisham-gsoftconsulting opened this issue Jan 21, 2025 · 4 comments
Open
2 tasks done
Labels
hosting Issue related to Amplify Hosting investigating The issue is being investigated pending-community-response Issue is pending a response from the author or community pending-triage Incoming issues that need categorization

Comments

@ahtisham-gsoftconsulting

How did you install the Amplify CLI?

i use Amplify console not cli

If applicable, what version of Node.js are you using?

22 and nextjs 15.1.5

Amplify CLI Version

not confirmed

What operating system are you using?

Default

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

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:

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/
/*
buildPath: /
appRoot: apps/appname

Describe the bug

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:

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/
/*
buildPath: /
appRoot: apps/appname

Expected behavior

Should able to run

Reproduction steps

click here and check faild with 500

Image

https://omnipulse-develop.d3hg6hq52rj16l.amplifyapp.com/

Project Identifier

Image

Log output

no

Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@ahtisham-gsoftconsulting ahtisham-gsoftconsulting added the pending-triage Incoming issues that need categorization label Jan 21, 2025
@ykethan
Copy link
Member

ykethan commented Jan 21, 2025

Transferring this issue as this appears to be related to Amplify console build.

@ykethan ykethan transferred this issue from aws-amplify/amplify-cli Jan 21, 2025
@ykethan ykethan added the hosting Issue related to Amplify Hosting label Jan 21, 2025
@Jay2113
Copy link

Jay2113 commented Jan 27, 2025

Hi @ahtisham-gsoftconsulting 👋 , thanks for reaching out. Can you verify a couple of things:

  1. Did you observe any errors locally? You can run a production build via npm run build and then open the link on localhost.
  2. What Node version are you using locally? It's possible that the application may be using a different Node version and fails to run on Node 22. You can adjust the Node version at build time via nvm use 20 and it will translate to the compute runtime.

@Jay2113 Jay2113 added the pending-community-response Issue is pending a response from the author or community label Jan 27, 2025
@ahtisham-gsoftconsulting
Copy link
Author

hi @Jay2113 local build working fine i try with node 20 also for amplify build but same issue . this issue occur in nextjs 15 . when i downgraded to 14 app working fine

@lengieng
Copy link

lengieng commented Jan 28, 2025

I'm having the same issue. My setup is:

  • Monorepo using npm workspace
  • Next.js 15.0.3
  • Tried both Node v18.20.4 and 20.18.2

Build and deploy completed successfully, but I got HTTP ERROR 500 when opening the deployed URL.

Hosting compute logs are exactly the same as OP's.

@Jay2113 Jay2113 added the investigating The issue is being investigated label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hosting Issue related to Amplify Hosting investigating The issue is being investigated pending-community-response Issue is pending a response from the author or community pending-triage Incoming issues that need categorization
Projects
None yet
Development

No branches or pull requests

4 participants