Skip to content

Fix blank screen on PDF ENOENT error#125

Open
gumclaw wants to merge 2 commits intomainfrom
fix/pdf-viewer-enoent-error-state
Open

Fix blank screen on PDF ENOENT error#125
gumclaw wants to merge 2 commits intomainfrom
fix/pdf-viewer-enoent-error-state

Conversation

@gumclaw
Copy link
Copy Markdown

@gumclaw gumclaw commented Mar 29, 2026

Summary

  • Adds error state to the PDF viewer that shows a user-facing error message with a "Try Again" button when react-native-pdf encounters a file error (e.g. ENOENT from cache eviction)
  • "Try Again" clears the error and re-mounts the Pdf component via key counter, triggering a fresh download
  • Keeps existing Sentry.captureException call for monitoring

Fixes https://gumroad-to.sentry.io/issues/7373029708/

Test plan

  • Verify error UI appears when PDF fails to load (covered by new unit tests)
  • Verify "Try Again" re-mounts the PDF component and clears the error state
  • Run npx jest tests/app/pdf-viewer.test.tsx — 2 tests pass
  • Run npx tsc --noEmit — no type errors

🤖 Generated with Claude Code

When react-native-pdf encounters a file-not-found error (e.g. cache
eviction between download and render), users previously saw a blank
screen with no feedback. Now we show an error message with a "Try Again"
button that re-mounts the PDF component.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants