fix: copy public/ and .next/static/ into standalone output on deploy
Some checks are pending
Playwright Tests / test (push) Waiting to run

next.config.js sets output: 'standalone', but Next.js does not copy public/
or .next/static/ into .next/standalone — that is a documented manual step.
Skipping it shipped new server code referencing new chunk hashes while the
old chunks stayed in the standalone tree, so those requests 404'd, React
never hydrated, and pages hung on "Loading session..." while the API kept
returning 200.

v1.114.2

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
mARTin-B78 2026-09-02 13:13:42 +02:00
parent 3338978163
commit 2028ba80e0
4 changed files with 21 additions and 3 deletions

View File

@ -2,6 +2,15 @@
All notable changes to this project are documented in this file.
## [1.114.2] - 2026-09-01
### Fixed
- Deploy script: copy `public/` and `.next/static/` into `.next/standalone/` after the build.
`next.config.js` sets `output: 'standalone'`, and Next.js does not copy those itself. Without
the copy every deploy left the old chunk hashes in the standalone tree, so the browser's
requests for the new chunks 404'd, React never hydrated, and the app hung on "Loading
session..." — while the API kept returning 200, which made it look like an auth problem.
## [1.114.1] - 2026-09-01
### Added

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "my-weekly-todo-list",
"version": "1.114.1",
"version": "1.114.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "my-weekly-todo-list",
"version": "1.114.1",
"version": "1.114.2",
"license": "MIT",
"dependencies": {
"@auth/prisma-adapter": "^2.11.1",

View File

@ -1,6 +1,6 @@
{
"name": "my-weekly-todo-list",
"version": "1.114.1",
"version": "1.114.2",
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
"main": "index.js",
"scripts": {

View File

@ -36,6 +36,15 @@ main() {
echo "--- Building application ---"
npm run build
# next.config.js sets output: 'standalone', and Next.js does NOT copy public/ or
# .next/static/ into .next/standalone — that is a documented manual step. Skipping it
# ships new server code whose HTML references new chunk hashes while the old chunks sit
# in the standalone tree: they 404, React never hydrates, and every page hangs on its
# server-rendered shell ("Loading session...") while the API still answers 200.
echo "--- Copying static assets into standalone output ---"
cp -r public .next/standalone/
cp -r .next/static .next/standalone/.next/
echo "--- Restarting PM2 process ---"
pm2 restart "$PM2_APP" --update-env
pm2 save