aws-amplify / aws-amplify/amplify-hosting
Deploy failed with "No ssrResources.json file" message
- 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 bug reports](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
### App Id
d3uf7no1t1cjcs
### Region
us-east-1
### Amplify Hosting feature
_No response_
### Describe the bug
I have a next.js SSR app hosted on Amplify. The deployment stage is failing with error "Cannot find any generated SSR resources to deploy": [ERROR]: {"code":"7","message":"No ssrResources.json file"}.
I have tried several things to no avail:
- followed [the instructions](https://docs.aws.amazon.com/amplify/latest/userguide/server-side-rendering-amplify.html#deploy-nextjs-app) and everything seems correctly configured for SSR, including the new service role.
- deleted and re-created the Amplify app
- downgraded Next to version 11
### Expected behavior
Amplify correctly detecting SSR app and deploying
### Reproduction steps
1. click the "redeploy this version" button on the build page
### Build Settings
```yaml
frontend:
phases:
preBuild:
commands:
- npm ci
build:
commands:
- npm run build
artifacts:
baseDirectory: .next
files:
- '**/*'
cache:
paths:
- node_modules/**/*
```
### Additional information
_No response_
Contributor guide
Research direction
Start with the provided Amplify build settings and the .next artifact directory, then compare the deployment setup with the linked Next.js SSR deployment guide. Reproduce the failure using the “redeploy this version” action and inspect whether the build produces the expected SSR resources. Done means Amplify detects the Next.js SSR app and completes deployment without the missing ssrResources.json error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, next.js
- Domain
- cloud, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100