Repository navigation
fix(aws-node-nextjs-web-app): update next to a patched release and add a live test - #840
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lesson
A Next.js app runs on AWS Lambda Web Functions from the standalone server that
next buildwrites: onewebAppsentry ships.next/standalone/as it is (build: false), and the same server serves pages, route handlers and the static assets the build script copies in. No adapter, no handler.Left out on purpose: custom domains, a CDN or S3 for static assets, IAM-authorized endpoints, image optimization settings, environment variables and VPC access. The docs page and the Next steps links cover them.
Changes
package.json/package-lock.json:nextpinned to16.4.6, the latest 16.x release (the lockfile had16.4.0;16.4.6is the patched release);reactandreact-dompinned to19.3.1, the current release (the checker'sexact-versionrule).npm audit(dev dependencies included): 0 vulnerabilities.example.json(new): manifest with the title and description the gallery already shows, and afastlive test with twohttpchecks on the stack outputSiteWebFunctionUrl:/api/hellomust answer 200 withHello from a Next.js route handler!, and/lambda.svgmust answer 200 with the image'sfill="#fd5750", which is only there when the build script copiedpublic/into the standalone output.test/prepare.mjs(new): runsnpm run buildafternpm ciand before the deploy, as the README's Deploy section does. The runner copies the example without a build, so the deploy depends on it.README.md: restructured into the standard sections (What it deploys, Prerequisites, Deploy, Try it, How it works, Cost and cleanup, Next steps); the local run, Dev Mode and logs sections are H3s under How it works; the two relative links are absolute; output pasted from a run with Framework 4.47.0 and Next.js 16.4.6; Try it runs the requests the checks assert; Cost names what is billed, with pricing links. Frontmatter and badge line regenerated bynpm run docs.serverless.yml,next.config.mjsandapp/are unchanged. The example is not an onboarding example.Test plan
us-east-1, Framework 4.47.0.PASS aws-node-nextjs-web-app 4.47.0 109s(stageexontpwe7nk), both checks passed.containschanged toHello from not-Next.js!):FAIL zz-neg-next 4.47.0 195sat thecheckstep,expected status 200 and a body containing "Hello from not-Next.js!"; ... the last response was status 200, body "{\"message\":\"Hello from a Next.js route handler!\",...}". The prepare step built the app and the deploy succeeded first.npm install,npm run build,serverless deploy,curlon/api/hello,/lambda.svg,/and its CSS file,serverless invoke --web-app site --path /api/hello,serverless info --verbose(showsSiteWebFunctionUrl),serverless logs --web-app site,npm startlocally,serverless remove. All matched the README.serverless devwas not run; that section is unchanged apart from its heading level./api/hello,lambda.svg, the page and its CSS file answered 200;serverless invoke --web-app site --path /api/helloprintedHTTP 200 OKand the route handler's body), removed it and confirmed the stack and log groups were gone.npm test(323 pass),npm run validate(0 errors),node scripts/check-examples.mjs aws-node-nextjs-web-app(0 errors),npm run check-docsclean.check-examples.mjs --packagestops withNo file matches include / exclude patterns, because it packages without runningtest.prepare, so.next/standalone/does not exist; the live test covers packaging.Generated by Claude Code