Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: stop self-update crashing at esbuild rebuild when esbuild isn't hoisted
[._.]/ Adam Eivyb01dcd9fb344
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 9bee267749..4e2936d025 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -32,5 +32,6 @@- **[issue-724] Local video renders no longer hang after finishing** — if a local video model finishes writing its file but its process refuses to exit (a known teardown stall on some Apple-silicon runtimes), PortOS now force-stops it after a short grace period instead of leaving the render — and the next one in line — wedged indefinitely.- **[issue-766] Episode Video renders cleanly when a remembered model is gone** — if the video model you previously pinned for an episode has since been removed, the render now quietly falls back to your default model instead of failing partway through.- **[issue-728] Imported stories no longer fake a "Ready" aesthetic or reader map** — when you start a Story Builder session from an import, only the steps the importer actually fills (idea, plot arc, characters, issues) open as "Ready" to review. The Universe Aesthetic and Reader Map steps now start "pending" instead of showing an empty step under a misleading "Ready" badge, so you generate them like you would in a from-scratch build.+- **Self-update no longer crashes at the "Rebuilding esbuild" step** — the updater rebuilt esbuild via a hardcoded `node_modules/esbuild/install.js` path that assumed esbuild was hoisted to the top of each dependency tree. It no longer is (esbuild nests under Vite/Vitest, and the server dropped its esbuild dependency entirely with Vitest 4 → Vite 8), so the path 404'd and aborted the whole update with exit code 1. The updater now uses `npm rebuild esbuild`, which finds esbuild wherever it lives and skips cleanly when absent; the same fix lands in `npm run install:all` and the Windows updater.## Removeddiff --git a/.npmrc b/.npmrcindex f1444d0846..05d644cf8d 100644--- a/.npmrc+++ b/.npmrc@@ -2,7 +2,7 @@# Packages with legitimate install scripts are explicitly rebuilt in `npm run install:all`.## Trusted packages requiring install scripts:-# esbuild (client + server) — downloads platform-specific binary+# esbuild (client; nested under vite/vitest) — downloads platform-specific binary# node-pty (server) — builds native PTY addon# sharp (server) — fetches/builds libvips native bindingignore-scripts=truediff --git a/package.json b/package.jsonindex 56e9f7ea24..891644ac9e 100644--- a/package.json+++ b/package.json@@ -20,7 +20,7 @@"pm2:startup": "node ./node_modules/pm2/bin/pm2 startup","install:all": "npm run setup","migrations": "node scripts/run-migrations.js",- "setup": "git submodule update --init --recursive && npm install && npm install --prefix client && npm install --prefix server && npm install --prefix autofixer && node client/node_modules/esbuild/install.js && node server/node_modules/esbuild/install.js && npm rebuild node-pty sharp --prefix server && node scripts/setup-data.js && node scripts/setup-db.js && node scripts/setup-llm.js && node scripts/setup-browser.js",+ "setup": "git submodule update --init --recursive && npm install && npm install --prefix client && npm install --prefix server && npm install --prefix autofixer && npm rebuild esbuild --prefix client && (npm rebuild esbuild --prefix server || true) && npm rebuild node-pty sharp --prefix server && node scripts/setup-data.js && node scripts/setup-db.js && node scripts/setup-llm.js && node scripts/setup-browser.js","setup:data": "node scripts/setup-data.js","setup:db": "node scripts/setup-db.js","setup:llm": "node scripts/setup-llm.js",diff --git a/update.ps1 b/update.ps1index bb203a2160..b07004c092 100644--- a/update.ps1+++ b/update.ps1@@ -183,12 +183,18 @@ Safe-Install -Dir "client" -Label "client"Safe-Install -Dir "server" -Label "server"Safe-Install -Dir "autofixer" -Label "autofixer"-# Run trusted install scripts skipped by ignore-scripts=true in .npmrc+# Run trusted install scripts skipped by ignore-scripts=true in .npmrc.+# Use `npm rebuild esbuild` rather than a hardcoded node_modules/esbuild/install.js+# path: esbuild is no longer hoisted to the top of either tree (it nests under+# vite/vitest), and the server has no direct esbuild dependency at all since+# vitest 4 → vite 8 dropped it — so the old install.js path 404'd and crashed+# the update. `npm rebuild` finds esbuild wherever it lives and no-ops cleanly+# when absent. Server rebuild is non-fatal (esbuild is a test-only transitive+# there, not needed for runtime or the production build).Write-SafeHost "🔧 Rebuilding esbuild, node-pty & sharp..." -ForegroundColor Yellow-Invoke-Logged node client/node_modules/esbuild/install.js-if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }-Invoke-Logged node server/node_modules/esbuild/install.js+Invoke-Logged npm rebuild esbuild --prefix clientif ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }+Invoke-Logged npm rebuild esbuild --prefix serverInvoke-Logged npm rebuild node-pty sharp --prefix serverif ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }Write-SafeHost ""diff --git a/update.sh b/update.shindex ec10170038..098293f790 100755--- a/update.sh+++ b/update.sh@@ -124,10 +124,18 @@ safe_install clientsafe_install serversafe_install autofixer-# Run trusted install scripts skipped by ignore-scripts=true in .npmrc+# Run trusted install scripts skipped by ignore-scripts=true in .npmrc.+# Use `npm rebuild esbuild` rather than a hardcoded node_modules/esbuild/install.js+# path: esbuild is no longer hoisted to the top of either tree (it nests under+# vite/vitest), and the server has no direct esbuild dependency at all since+# vitest 4 → vite 8 dropped it — so the old `node server/node_modules/esbuild/install.js`+# path 404'd and hard-crashed the whole update under `set -e`. `npm rebuild`+# finds esbuild wherever it lives, runs its install script, and no-ops cleanly+# when the package is absent. Server rebuild is fault-tolerant (esbuild is a+# test-only transitive there, not needed for runtime or the production build).log "🔧 Rebuilding esbuild, node-pty & sharp..."-run node client/node_modules/esbuild/install.js-run node server/node_modules/esbuild/install.js+run npm rebuild esbuild --prefix client+run npm rebuild esbuild --prefix server || truerun npm rebuild node-pty sharp --prefix serverlog ""