I added new secrets example ABC_URL under deployment and republished, the new secrets after republish disappears and the app fails with no ABC_URL not found , also not able to add a new port under network tab, everytime I add it disappears
What you’re hitting is almost certainly a mix-up between Replit’s two separate secret stores. There’s the workspace Secrets in the sidebar (used while developing) and the Deployment Secrets inside the Deployment config (used by the published app). They don’t sync. The “added → republished → disappeared” pattern usually means the secret got added to one store but you’re looking at the other, or it was added to the deployment store without triggering an actual rebuild.
The port symptom points the same direction. For Autoscale and Reserved VM deployments, the exposed port is whatever your app listens on via process.env.PORT — you don’t manually add ports in the Network tab for a deployment. That tab controls the dev workspace preview, and changes there don’t carry into a deployment. The UI silently dropping your port additions is consistent with that being the wrong layer to configure.
Try this sequence:
Open the Deployment (not the workspace), find the Secrets panel inside the deployment config, and confirm ABC_URL exists there — not in workspace Secrets.
After adding a deployment secret, click Save and trigger a full Redeploy, not just a restart. Running deployments don’t always pick up new env vars without a rebuild.
Verify the secret name is a valid env var: letters, digits, underscores, no leading digit, no spaces.
In your code, make sure the server listens on process.env.PORT rather than a hardcoded port, and stop trying to set ports in the Network tab for the deployment.
Add a quick startup log: console.log(‘ABC_URL present:’, !!process.env.ABC_URL). Check the deployment logs right after redeploy — this tells you instantly whether the deployment actually received the secret.
If it’s still failing, delete the deployment and recreate it from scratch. Deployment configs occasionally get into a stuck state.
Check status.replit.com to rule out a current platform incident before assuming an app-level fault.
If after step 5 the log says present: false even though the secret is clearly in the deployment store, that’s a Replit-side bug worth escalating with the deployment ID.