From 612fc69acfad2811573fa4375332b47342fe9118 Mon Sep 17 00:00:00 2001 From: sirpiglr <49359077-sirpiglr@users.noreply.replit.com> Date: Tue, 2 Dec 2025 18:51:07 +0000 Subject: [PATCH] Fix server build to produce the correct output file for deployment Update Vite server build configuration to ensure `production.mjs` is generated, resolving a deployment error. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9203795e-937a-4306-b81d-b4d5c78c240e Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: e5d29f14-f45b-4502-aef7-ca0395bf135c Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7c94b7a0-29c7-4f2e-94ef-44b2153872b7/9203795e-937a-4306-b81d-b4d5c78c240e/23kpkkM Replit-Helium-Checkpoint-Created: true --- .replit | 6 +++++- replit.md | 2 ++ vite.config.server.ts | 9 ++------- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.replit b/.replit index a21b2533..2ad52d1e 100644 --- a/.replit +++ b/.replit @@ -37,7 +37,11 @@ externalPort = 80 localPort = 38557 externalPort = 3000 +[[ports]] +localPort = 40437 +externalPort = 3001 + [deployment] deploymentTarget = "autoscale" -run = ["npm", "start"] +run = ["node", "dist/server/production.mjs"] build = ["npm", "run", "build"] diff --git a/replit.md b/replit.md index efd4809f..ca02bf1a 100644 --- a/replit.md +++ b/replit.md @@ -81,9 +81,11 @@ npm start # Start production server ## Recent Changes (December 2, 2025) - ✅ Configured Vite to run on port 5000 for Replit compatibility - ✅ Set up proper host configuration (0.0.0.0) for Replit proxy +- ✅ Added `allowedHosts: true` to allow Replit's dynamic proxy hostnames - ✅ Updated .gitignore to properly exclude environment files - ✅ Installed all npm dependencies - ✅ Configured deployment settings for Replit autoscale +- ✅ Fixed server build to output `dist/server/production.mjs` for deployment - ✅ Verified application runs without errors in Replit environment ## Notes diff --git a/vite.config.server.ts b/vite.config.server.ts index aabcd0bb..a3625823 100644 --- a/vite.config.server.ts +++ b/vite.config.server.ts @@ -4,16 +4,11 @@ import path from "path"; // Server build configuration export default defineConfig({ build: { - lib: { - entry: path.resolve(__dirname, "server/node-build.ts"), - name: "server", - fileName: "production", - formats: ["es"], - }, outDir: "dist/server", target: "node22", ssr: true, rollupOptions: { + input: path.resolve(__dirname, "server/node-build.ts"), external: [ // Node.js built-ins "fs", @@ -35,7 +30,7 @@ export default defineConfig({ ], output: { format: "es", - entryFileNames: "[name].mjs", + entryFileNames: "production.mjs", }, }, minify: false, // Keep readable for debugging