actualbudget/actual · warning · Error
getModifiedTime not supported on the web (only used for back
Error message
getModifiedTime not supported on the web (only used for backups)
What it means
The web build of the server `fs` module cannot stat files for modification times because IndexedDB has no metadata API. `getModifiedTime` is intentionally unimplemented and always throws; it exists only to satisfy the fs type interface and is used solely for the backup feature.
Source
Thrown at packages/loot-core/src/platform/server/fs/index.ts:454
if (await exists(dirpath)) {
for (const file of await listDir(dirpath)) {
const fullpath = join(dirpath, file);
// `true` here means to not follow symlinks
const attr = FS.stat(fullpath, true);
if (FS.isDir(attr.mode)) {
await removeDirRecursively(fullpath);
} else {
await removeFile(fullpath);
}
}
await removeDir(dirpath);
}
};
export const getModifiedTime = async (_filepath: string): Promise<Date> => {
throw new Error(
'getModifiedTime not supported on the web (only used for backups)',
);
};
View on GitHub (pinned to d4334cb6e6)
Solutions
- Only use getModifiedTime on node/electron builds; gate the call on platform
- Track mtimes yourself (store a timestamp when you write the file via _writeFile) instead of asking the fs
- If you need it on web, patch the module to return a stored metadata timestamp — but the upstream API intentionally does not support it
Example fix
// before
const mtime = await fs.getModifiedTime(path);
// after
let mtime = null;
if (typeof window === 'undefined') {
mtime = await fs.getModifiedTime(path);
} Defensive patterns
Strategy: fallback
Validate before calling
const supportsMtime = typeof window === 'undefined'; // web build always throws
if (!supportsMtime) console.warn('getModifiedTime unavailable on web'); Try / catch
try {
mtime = await fs.getModifiedTime(path);
} catch (e) {
if (String(e).includes('getModifiedTime not supported on the web')) {
mtime = fallbackMtimeFromMetadata(path); // stored timestamp at write time
} else throw e;
} Prevention
- Gate backup/mtime logic behind a platform check
- Record your own timestamps when writing files if you later need mtimes
- Do not call backup-scheduling code paths in the web build
When it happens
Trigger: Calling `getModifiedTime(filepath)` in the browser build — directly or via backup-scheduling code that checks file mtimes.
Common situations: Shared code written against the node/electron fs running in the web build; a plugin or custom integration attempting to inspect file timestamps client-side.
Related errors
- File does not exist: ${filepath}
- ACTUAL_DATA_DIR env variable is required
- Failed to copy SQL file from ${frompath} to ${topath}: ${sec
AI-assisted analysis of actualbudget/actual@d4334cb6e6 (2026-08-29).
Data as JSON: /api/errors/60a2fc932b05f0e6.
Report an issue: GitHub.