From 2028ba80e092310c2481c572c82406a5e6b7f693 Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Wed, 2 Sep 2026 13:13:42 +0200 Subject: [PATCH] fix: copy public/ and .next/static/ into standalone output on deploy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- CHANGELOG.md | 9 +++++++++ package-lock.json | 4 ++-- package.json | 2 +- scripts/update-app.sh | 9 +++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a14620..e546372 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/package-lock.json b/package-lock.json index 4201f0d..03d9eb8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index cf70348..720ee5c 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/scripts/update-app.sh b/scripts/update-app.sh index 3785ee8..82cc4bd 100644 --- a/scripts/update-app.sh +++ b/scripts/update-app.sh @@ -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