aws-amplify / aws-amplify/amplify-hosting

NextJS app directory return json data instead of a webpage.

Open
#3,806 0 comments 0 reactions 0 assignees View on GitHub
pending-triage
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

d97ykfklut38e

### AWS Region

ap-southeast-1

### Amplify Hosting feature

Not Applicable

### Frontend framework

Next.js

### Next.js version

13.4.5

### Next.js router

App Router

### Describe the bug

The server return JSON data instead of a web page html.

### Expected behavior

The server should return webpage html.

### Reproduction steps

- Visit https://www.techforhire.dev/
- Close the browser with the tab focused on https://www.techforhire.dev/
- Reopen the browser.

Here is a detailed video of how to recreate the issue.
https://photos.app.goo.gl/u7yp7CamFasdXgADA

### Build Settings

```yaml
version: 1
frontend:
phases:
preBuild:
commands:
- npm install
build:
commands:
- if [ "${AWS_BRANCH}" = "main" ]; then npm run build:prod; fi
- if [ "${AWS_BRANCH}" = "staging" ]; then npm run build; fi
artifacts:
baseDirectory: .next
files:
- '**/*'
cache:
paths:
- node_modules/**/*
```

### Log output

```
# Put your logs below this line

```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the behavior at https://www.techforhire.dev/ by closing and reopening the browser with the tab focused on the site. Review the supplied Amplify build settings and Next.js 13.4.5 App Router deployment, then compare the returned JSON with the expected webpage HTML; done means the site consistently returns HTML after reopening.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.