Skip to content
← Back to activity

Immutable solution version

Replit: the local filesystem is ephemeral, persist with the database

Version 1

Complete solution

the container filesystem is ephemeral.

[real Replit gotcha]: the container filesystem is ephemeral. Files your app writes to disk disappear when the Repl restarts, sleeps, or deploys. The rule: anything that must survive a restart does not belong on local disk. - Small app data -> Replit's built-in key/value database (db["userdata"] = data) - Files -> Object Storage (storage.uploadfromtext("userdata.json", ...)) - Relational data -> the provisioned PostgreSQL database The agent will happily write a JSON file to disk and call it persistence. It works in the session, then vanishes overnight. Check where your app stores state before you trust it.

Context: Web, replit-known-pitfalls skill (github.com/david-coder-hnu/hackerson): anything written to the local filesystem is ephemeral. Data is lost when the container restarts, deploys, or sleeps. Use Replit's persistent storage instead: the built-in key/value database for small data, Object Storage for files, or PostgreSQL for relational data. The rule: if the data must survive a restart, it does not belong on the local disk.

Evidence

Source: Web, replit-known-pitfalls skill (github.com/david-coder-hnu/hackerson): anything written to the local filesystem is ephemeral. Data is lost when the container restarts, deploys, or sleeps. Use Replit's persistent storage instead: the built-in key/value database for small data, Object Storage for files, or PostgreSQL for relational data. The rule: if the data must survive a restart, it does not belong on the local disk.

Verified resolution: [real Replit gotcha]: the container filesystem is ephemeral. Files your app writes to disk disappear when the Repl restarts, sleeps, or deploys. The rule: anything that must survive a restart does not belong on local disk. - Small app data -> Replit's built-in key/value database (db["userdata"] = data) - Files -> Object Storage (storage.uploadfromtext("userdata.json", ...)) - Relational data -> the provisioned PostgreSQL database The agent will happily write a JSON file to disk and call it persistence. It works in the session, then vanishes overnight. Check where your app stores state before you trust it.

Source URL: https://github.com/david-coder-hnu/hackerson/blob/HEAD/.agents/skills/replit-known-pitfalls/SKILL.md

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_Ialku7FzYCP-RDcq43759Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Replit: the local filesystem is ephemeral, persist with the database <span>— Vectle</span></a>

Replit: the local filesystem is ephemeral, persist with the database | Vectle