nitrojs / nitrojs/nitro

`preset: "aws-amplify"` does not generate index.html

Open
#3,288 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug nuxt v2
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

Environment

nuxt 3.16.2
└── nitropack 2.11.8

node 18.13.0

pnpm 10.4.1

Reproduction

https://github.com/hajiifu/repro-nuxt-generate/

Describe the bug

The nuxt generate command does not generate index.html or other routes such as about.

When I try it locally (when preset is static) it looks fine, but the route is not prerender correctly in the AWS Amplify hosting pipeline.

When I try to reproduce it locally with preset: “aws-amplify” I get a similar situation.

Because of this I get a 404 when accessing the Amplify application.

Additional context

No response

Logs
> nuxt generate

[ nuxi  0:38:27] Nuxt 3.16.2 with Nitro 2.11.8
[ nuxi  0:38:29] ℹ Building for Nitro preset: aws-amplify
[0:38:30] ℹ Building client...
[0:38:30] ℹ vite v6.2.5 building for production...
[0:38:31] ℹ ✓ 137 modules transformed.
[0:38:31] ℹ .nuxt/dist/client/manifest.json                   3.09 kB │ gzip:  0.48 kB
[0:38:31] ℹ .nuxt/dist/client/_nuxt/error-500.CVS4jKuj.css    1.88 kB │ gzip:  0.72 kB
[0:38:31] ℹ .nuxt/dist/client/_nuxt/error-404.BB4Ye6hK.css    3.56 kB │ gzip:  1.10 kB
[0:38:31] ℹ .nuxt/dist/client/_nuxt/yUUGDThL.js               0.20 kB │ gzip:  0.18 kB
[0:38:31] ℹ .nuxt/dist/client/_nuxt/Dzaf0NBM.js               0.21 kB │ gzip:  0.19 kB
[0:38:31] ℹ .nuxt/dist/client/_nuxt/DIho2ksS.js               0.30 kB │ gzip:  0.22 kB
[0:38:31] ℹ .nuxt/dist/client/_nuxt/D2tdmYhX.js               0.41 kB │ gzip:  0.28 kB
[0:38:31] ℹ .nuxt/dist/client/_nuxt/BnFyyr80.js               0.55 kB │ gzip:  0.30 kB
[0:38:31] ℹ .nuxt/dist/client/_nuxt/DYivP7rT.js               3.41 kB │ gzip:  1.54 kB
[0:38:31] ℹ .nuxt/dist/client/_nuxt/DwkqfyqK.js               3.79 kB │ gzip:  1.72 kB
[0:38:31] ℹ .nuxt/dist/client/_nuxt/C0P8YdRB.js               5.70 kB │ gzip:  2.21 kB
[0:38:31] ℹ .nuxt/dist/client/_nuxt/Bd-Ax4RY.js             163.56 kB │ gzip: 62.13 kB
[0:38:31] ℹ ✓ built in 782ms
[0:38:31] ✔ Client built in 791ms
[0:38:31] ℹ Building server...
[0:38:31] ℹ vite v6.2.5 building SSR bundle for production...
[0:38:31] ℹ ✓ 85 modules transformed.
[0:38:32] ℹ ✓ built in 438ms
[0:38:32] ✔ Server built in 443ms
[nitro 0:38:32] ℹ Initializing prerenderer
[nitro 0:38:32] ℹ Prerendering 2 routes
[nitro 0:38:32]   ├─ /404.html (19ms)
[nitro 0:38:32]   ├─ /200.html (19ms)
[nitro 0:38:32] ℹ Prerendered 2 routes in 0.586 seconds
[nitro 0:38:32] ✔ Generated public .amplify-hosting/static
[nitro 0:38:32] ✔ You can preview this build using node .amplify-hosting/compute/default/server.js
[ nuxi  0:38:32] ✔ You can now deploy .amplify-hosting/static to any static hosting!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproduction repository at https://github.com/hajiifu/repro-nuxt-generate/ and run nuxt generate using the aws-amplify preset, comparing it with the static preset. Trace the preset's prerendering behavior and verify that index.html and routes such as about are generated so the deployed Amplify application no longer returns 404.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, nuxt, typescript
Domain
build-system, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.