aws-amplify / aws-amplify/amplify-hosting

NextJS deployement failed: [ERROR]: {"code":"7","message":"No ssrResources.json file"}

Open
#3,081 10 comments 1 reaction 0 assignees View on GitHub
bug frontend-builds investigating ssr
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.
- [X] I have removed any sensitive information from my code snippets and submission.

### App Id

d10qoyiwa3p4ur

### AWS Region

ap-south-1

### Amplify Hosting feature

Build settings, Deployments

### Describe the bug

I've a couple of Next JS application deployed on AWS amplify with separate AWS profiles, and all of them started failing 2 days ago (i.e, 2nd Nov, 2022). Surprisingly, the already deployed branches, if re-deployed, are being re-deployed fine but any new branch when deployed, gets failed in the "Deploy" part of the deployment. Provision and Build phases do succeed though.
My guesses are NextJS version update might be an issue, currently we're using NextJS version 12 and in the package.json, I've restricted the version to 12. My applications currently aren't having SSG components/pages.
Screenshot 2022-11-04 at 12 09 40 PM

********* IMAGE OF DEPLOYMENTS ERRORS ARE ATTACHED ************

### Expected behavior

The Next JS app should be deployed successfully because it doesn't have any errors in the build phase

### Reproduction steps

1. Create a Next JS application
2. Deploy it on AWS amplify
3. Amplify shoes an error on the Deployment phase

### Build Settings

_No response_

### Log output

```
# Put your logs below this line

2022-11-04T06:51:00 [INFO]: Beginning deployment for application d10qoyiwa3p4ur, branch:feature/FM-69-auth-module, buildId 0000000002
2022-11-04T06:51:01 [INFO]: Cannot find any generated SSR resources to deploy. If you intend for your app to be SSR, please check your app Service Role permissions. Otherwise, please check out our docs on how to setup your app to be detected as SSG (https://docs.aws.amazon.com/amplify/latest/userguide/server-side-rendering-amplify.html#deploy-nextjs-app)
2022-11-04T06:51:01 [ERROR]: {"code":"7","message":"No ssrResources.json file"}

```

### Additional information

Screenshot 2022-11-04 at 12 09 40 PM

Contributor guide

Open the contributing guide

Research direction

Start with the deployment log showing the missing ssrResources.json file and compare a successfully redeployed existing branch with a failing new branch. Review the Next.js 12 application setup, package.json version restriction, and Amplify build settings, then reproduce the Provision, Build, and Deploy sequence. Done means a new branch deploys successfully without the missing SSR resource error.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs
Domain
cloud, devops
Issue type
Bug
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.