Skip to content

Commit 7199cee

Browse files
committed
Create compatibility symlink for Next.js SSR server entrypoint
1 parent d287513 commit 7199cee

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

crates/cli/src/deploy/process_deploy_nextjs_ssr.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,14 @@ pub async fn process_deploy_nextjs_ssr(env: Environment, config: Config) -> Resu
346346
cd "$APP_PATH"
347347
mkdir -p logs
348348
349+
# Backward compatibility: older operator-managed ecosystem.config.js files
350+
# still point PM2 at `.next/standalone/server.js`. The current deploy flow
351+
# rsyncs the *contents* of `.next/standalone/` into the app root, so the
352+
# real entrypoint is `server.js`. Create a compatibility symlink so both
353+
# layouts work and old PM2 configs do not crash after deploy.
354+
mkdir -p .next/standalone
355+
ln -sfn ../../server.js .next/standalone/server.js
356+
349357
echo "Starting $PM2_APP with pm2..."
350358
if pm2 describe "$PM2_APP" > /dev/null 2>&1; then
351359
pm2 delete "$PM2_APP"

0 commit comments

Comments
 (0)