A QuotaExceededError in IndexedDB happens when the browser denies a write operation because your app has exceeded its allowed storage quota. It’s a
storage limit issue and can be tricky, especially for offline-first apps.
Here's what causes it and how to handle it:
Common Causes of QuotaExceededError
Cause
Description
Too much data
You're trying to store more than the browser allows
Blob or large JSON payloads
Storing images, videos, or large arrays/objects
No user interaction yet
Storage quota is lower if the user hasn’t interacted with your app
Private/Incognito mode
Browsers severely restrict IndexedDB size in incognito (sometimes <1MB)
Shared quota limit
Your app shares a quota with other apps on the domain
Quota exceeded globally
The device’s total disk quota (not just your site) is full
Typical Limits (Approximate)
Browser
Persistent
Temporary (Default)
Incognito
Chrome
Up to 60% of free disk (with user permission)
~50MB–2GB
0–1MB
Firefox
~2GB or more
~50MB default
0–1MB
Safari
50MB (auto prompt at 5MB)
Very strict
0MB
📌 By default, most storage is temporary and limited unless
user grants permission (e.g. via Persistent Storage API)
How to Handle It Gracefully
1. Catch the Error
Wrap writes in a try/catch block:
try {
await db.items.bulkPut(largeData);
} catch (e) {
if (e.name === 'QuotaExceededError') {
alert('Storage limit exceeded. Try clearing old data or use less offline space.');
// Optional: trigger cleanup or switch to cloud-only mode
} else {
throw e;
}
}
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Here's what causes it and how to handle it:
Common Causes of
QuotaExceededErrorTypical Limits (Approximate)
How to Handle It Gracefully
1. Catch the Error
Wrap writes in a
try/catchblock:2. Estimate Available Storage
Use the StorageManager API:
3. Request Persistent Storage (Chrome, Edge)
4. Store Smaller Data
5. Clean Up Unused Data
Implement data expiration or LRU (Least Recently Used) cache patterns:
6. Limit Sync Queue Size
If using a sync queue (e.g. offline-first apps), cap it: