aws-amplify / aws-amplify/amplify-hosting

NextJS custom server support

Open
#3,334 3 comments 2 reactions 0 assignees View on GitHub
compute 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 read the guide for [submitting questions](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have removed any sensitive information from my code snippets and submission.

### App Id

d8bhu9x5u3nf0

### AWS Region

us-east-1

### Amplify Hosting feature

Not Applicable

### Question

Does AWS Amplify supports deployment of NextJS applications with [custom servers](https://nextjs.org/docs/advanced-features/custom-server)?

Does it execute the `start` command from the application's package.json, or does it use `next start` under the hood by default when spinning the application?
```json
"scripts": {
"start": "node -r ./instruments.js server.js",
}
```

I'm interested in having a custom server to instrument my application with OpenTelemetry. I was able to deploy it successfully but I have no evidence that my server was actually instrumented. Thanks in advance!

Contributor guide

Open the contributing guide

Research direction

Start with the application's package.json start script, then inspect server.js and instruments.js to understand the deployed process and instrumentation evidence. Done means the supported behavior for custom Next.js servers and the effective startup command are confirmed and documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, node.js
Domain
backend, cloud, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.