Data disappears after refresh in your AI-built app: why
Updated First published
On this page (4)
Symptom
You add items and they show up in the list, but they disappear when you reload the page. Or they stay on your computer but don't show up on your phone.
Cause
There are three common situations, from the simplest to the most complete:
- The app doesn’t save anything. The information lives only in the page’s memory and disappears when the page reloads.
- The app saves in the browser. The data survives a reload, but only in that browser, on that device. This is usually local storage (localStorage).
- The app saves in an online database. The data shows up on any device.
None of them is wrong in itself. What’s wrong is when the app is in one situation and you expect another. The prompt on this page asks the AI to tell you which one your app is in before it changes anything.
Find out which one you have (five minutes, no coding)
Do these in order. Stop at the first step that answers it.
- Open the app’s own link in its own tab. Use the published link, not the editor, so you’re looking at the app and not at the builder.
- Look in the browser’s storage. On a computer, open Chrome’s DevTools on your app, go to Application, then Storage, expand Local Storage and click your app’s address. Chrome’s docs say this lists the key-value pairs the site saved in localStorage. If your items, or text that looks like them, are there, the app saves in the browser (situation 2).
- Look in the database. In Lovable, open More → Database. Lovable’s docs say tables fill as soon as the app saves information, and the view doesn’t update live, so click Refresh after you add an item. In Bolt, click the database icon at the top center of the screen and open Tables (Bolt’s help page). If your items are listed, the data is saved, and the problem is on the way back out. If there’s no table, or it has no rows, the app isn’t saving to a database (situation 1 or 2).
- Try a second place. Open the same link on your phone or in another browser and sign in the same way. Items that show up there are in a database. Items that don’t are most likely in the first browser’s storage.
Then match what you saw:
| What you see | Most likely | What to do |
|---|---|---|
| Items vanish on every reload; nothing in Local Storage; no rows in the database | The app keeps them in memory only | Use the prompt on this page and ask where the data should be saved |
| Items in Local Storage; missing on your phone or in another browser | Saved in the browser (localStorage) | Ask for an online database if you need the data on other devices |
| Items were there for days, then gone on a Mac or iPhone using Safari | Safari cleared the site’s storage | See “When the browser deletes it” below |
| Items gone after you cleared browser data or closed a private window | The browser did what it’s meant to do | Same section |
| Rows are in the database, but the list is empty and there’s no error | A security rule (RLS) hides them, or you’re signed out | See the FAQ above and the database errors page |
| Lovable: you added items in a draft and they’re gone after accepting it | The draft had its own backend | See “Drafts and paused backends” below |
| Lovable or Bolt: the app was idle for days, then nothing loads | The backend was paused | Same section |
When the browser deletes it
localStorage is not a safe place for anything you can’t lose. MDN says browsers store data in “best-effort” mode by default: it stays as long as the site is under its quota, the device has enough space and you don’t delete it in the browser’s settings. The same MDN page says that, in private browsing, stored data is usually deleted when the private session ends, and that research from the Chrome team shows data is rarely deleted for sites you visit regularly.
Safari is stricter. A 2020 WebKit post on tracking prevention says Safari deletes all of a website’s script-writable storage, including localStorage and IndexedDB, after seven days of Safari use without interacting with that site. Web apps added to the Home Screen have their own counter of days of use. A 2023 WebKit post on storage policy adds that data can also be deleted when a site goes over its quota or the device is short on storage. These are posts from Apple’s WebKit team, so treat the seven-day figure as the rule when it was published in 2020, not as a promise about the Safari on your phone today.
The practical point is the same in every case: if the data matters, it belongs in a database.
Drafts and paused backends (Lovable and Bolt)
Two cases look like deleted data and aren’t.
A draft with its own backend. Lovable’s docs say a draft on a project with the built-in backend usually has a backend of its own, filled with example data instead of your real records. Data you add in that kind of draft stays in the draft, and accepting the draft never copies data from it. Other drafts share your live backend, and in those, changing data changes your live app right away. A banner in the preview tells you when you’re looking at example data.
A paused backend. Lovable’s docs say a project’s backend is paused automatically after about 7 days without activity, and that while it’s paused the published app can’t read or write data. The data stays in place. When the pause is for inactivity, opening the project in the editor wakes it up. Our page on a Lovable app that paused covers the other causes, like credits. Bolt’s docs say a Bolt Database with low usage for six days or more can be paused if the project isn’t published with Bolt hosting, and that Bolt restores it when you open the project. They add that on the Supabase Free plan, Supabase pauses a database after a week of low activity even when the project is published.
If the rows were really deleted
Check the cases above first. Then, in Lovable, you can restore from a daily backup (More → Database → Manage → Backups). Lovable’s docs say it keeps roughly 14 days of backups and that restoring can’t be undone: anything created or changed after the backup is lost, and your app’s code may stop matching the restored structure. Export the database before you restore. Deleting rows in the Database view can’t be undone either, so don’t edit records there while you’re still trying to find out what happened.
What to ask the AI once you know
If the check showed that the items are only in the browser and you need them everywhere, say that in one message:
My app keeps the [items] only in this browser (local storage). I want them saved in a database, so they're still there after a reload and on my phone.
Tell me which tables you'll create, what each one stores and who will be able to read it. Wait for my OK before you change anything.
The prompt Save your data online helps with the next step. If the whole Lovable project is gone, not just the data inside the app, see Deleted a Lovable project by mistake? If the data is in the database but the list shows nothing, or you see an error with a code like 42501, see Database errors in a vibe-coded app. And if the app works in the editor but not on the published link, see Lovable preview works but the published site doesn’t.
Sources
Checked on November 20, 2026: MDN: Window.localStorage and Storage quotas and eviction criteria; Chrome DevTools: View and edit local storage; WebKit, Full Third-Party Cookie Blocking and More (March 24, 2020) and Updates to Storage Policy (August 10, 2023); Lovable docs on Database, drafts, pausing a database, backups and the preview; Bolt’s database help page; Supabase’s Row Level Security guide.
Prompt to paste
Copy the text below, replace what’s in brackets and send it in the chat of the tool you’re using.
I added information to the app and it [disappears when I reload the page / doesn't show up on another device].
Explain in plain English where the app is storing the data today.
I need the data to [still be there when I reload / show up on any device].
Tell me what needs to change to make that happen, and wait for my confirmation before doing it.How not to burn credits
- Ask where the data is stored before asking for a fix, as the prompt does. Changing how an app saves data touches many parts, and you only want to pay for that once.
- Decide first whether you really need the data on other devices. For an app only you use, on one device, saving in the browser may be enough.
- When you do connect a database, ask for it in one complete request that says which information needs to be saved and who can see it.
- Run the five-minute check below before you ask for any fix. If the data was never saved, or an access rule hides it, rebuilding the app doesn't solve it.
How Lovable counts credits, and what the free plan includes: Lovable credits explained.
Questions people ask
Is saving on the device bad?
No. For an app that only you use, on a single device, it's the simplest way. The problem is when you expect to see the same data somewhere else.
The data is in the database but my list shows nothing (no error). Why?
A security rule (RLS) may be hiding the rows. Supabase's docs say that when a rule's "using" condition filters a row out, nothing is raised and zero rows match, so you get an empty list instead of an error. A rule like "people see their own rows" compares the row's owner with the signed-in user, so it can't match for someone who isn't signed in. Ask the AI to check the RLS policies for that table and whether the user is signed in when the list loads. Our page on database errors in a vibe-coded app explains this case in more detail.
Is localStorage a database?
Not the kind you need to share data. MDN describes localStorage as a storage space the browser keeps for each site, saved across browser sessions. It lives in that browser only, so it isn't shared with other browsers or devices, and clearing the browser's data erases it. In a private or incognito window, MDN says it's cleared when the last private tab closes. To see the same data anywhere, ask the AI to connect an online database.
Why do my items show on my laptop but not my phone?
Most likely the app saves them in your laptop's browser storage (localStorage). That storage belongs to the browser on that device and doesn't sync, so the browser on your phone has its own, empty one. For the items to show up on both, the app needs to save them in an online database.
Does the Lovable preview use a different database from the published app?
For the main version of your project, no. Lovable's docs say the preview and the published app share the same backend and data, so a change to your database affects both. Drafts are different. A draft usually gets a backend of its own, filled with example data, and data you add there stays in the draft. Lovable's docs say that accepting a draft never copies data from it.
Can I get deleted rows back in Lovable?
If the rows were really deleted, you can restore a daily backup from More → Database → Manage → Backups. Lovable's docs say it keeps roughly 14 days of backups, restoring can't be undone, and anything created after that backup is lost, so export your database first. Check the cases on this page before you restore, because a hidden list, a paused backend and a draft all look like deleted data, and none of them needs a restore.
New guides by email. An email when we publish a new guide, error fix or chapter, in plain English. Subscribe