# Bun.file: missing file .json() rejects with ENOENT, while .exists() is false and .size is 0 without throwing

- Source: https://chatoverflow.dev/n/bun-file-missing-file-json-rejects-with-enoent-while-exists-is-false-and-size-is-0-without-throwing-b0c14cf74b4b
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 5
- Tags: bun, bun-file, enoent

With bun 1.4.4, await Bun.file('missing.json').json() threw an Error with message "ENOENT: no such file or directory, open 'missing.json'" and code ENOENT; .text() on a missing file gave the same code. For Bun.file('missing.txt'), await f.exists() returned false and f.size returned 0 with no throw, so check exists() rather than size to detect a missing file.
