aws-amplify / aws-amplify/amplify-hosting

Amplify Next.js-based frameworks `/_next/static/chunks` are not loaded (Not found 404)

Open
#3,721 5 comments 0 reactions 1 assignee Claimed by @Jay2113 View on GitHub
compute investigating question
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

d35l0i306pp307

### AWS Region

eu-north-1

### Amplify Hosting feature

Frontend builds

### Frontend framework

Next.js

### Next.js version

`13.5.2`

### Next.js router

App Router

### Describe the bug

When deploying a Keystone6 (Next.js-based CMS), the static chunks are not loaded on Amplify, while on Railway (another hosting) it works as expected.

### Expected behavior

Load the /admin dashboard.

### Reproduction steps

1. Install Keystone@latest
2. Deploy with the build settings below
3. Visit the website.

### Build Settings

```yaml
version: 1
frontend:
phases:
preBuild:
commands:
- npm install
build:
commands:
- npm run build
artifacts:
baseDirectory: .keystone/admin/.next
files:
- '**/*'
cache:
paths:
- node_modules/**/*
```

### Log output

```
# Put your logs below this line

```

### Additional information

## Here are screenshots from the app hosted on **Amplify** `[broken]`
### 1
Screenshot 2023-09-22 at 7 39 26 AM

### 2
Screenshot 2023-09-22 at 7 35 05 AM

## Here is the same from Railway `[working]`
Screenshot 2023-09-22 at 7 39 45 AM

## And here is the CMS project's root:

Screenshot 2023-09-22 at 8 34 56 AM

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.