HonestPDF introduces a critical bugfix resolving PDF load failures caused by a pdfjs-dist version mismatch and a Content Security Policy block, restoring full functionality to four core tools.
TL;DR
A react-pdf worker version mismatch and a missing CSP directive were silently breaking PDF loading in the Redact, Sign, Fill, and Edit tools. Both issues are resolved. A zero-CLS PathPilot cross-promotion banner was also added, and 334 em-dashes were stripped from 18 locale files.
What's New
- pdfjs-dist pinned to 5.4.296: Resolved a version mismatch between react-pdf and pdfjs-dist that caused the worker script to load from an incompatible version, silently failing PDF rendering in Redact, Sign, Fill, and Edit tools.
- CSP connect-src updated: Added
blob:anddata:to the Content Security Policyconnect-srcdirective, fixing 'Unexpected server response' errors triggered when react-pdf internally constructs its worker via blob URLs. - PathPilot cross-promotion banner: Added dismissible announcement components in three placements (top bar, post-download, footer). Implemented with a pre-paint inline script reading
localStoragebefore DOM render to achieve zero Cumulative Layout Shift (CLS). - Locale punctuation cleanup: Stripped 334 em-dashes across 18 translation files, replacing them with standard hyphens for consistent rendering across all 20 supported languages.
How to Use
No action required for end users. If you're self-hosting or building on top of this repo, ensure your CSP connect-src includes blob: and data: when using react-pdf:
Content-Security-Policy: connect-src 'self' blob: data:;
For the zero-CLS banner pattern, a pre-paint inline script runs before hydration:
// Inline in <head> before any paint
const dismissed = localStorage.getItem('pathpilot-banner-dismissed');
if (dismissed) document.documentElement.classList.add('banner-hidden');
This prevents the banner from flashing in and out on repeat visits without waiting for React to hydrate.
Breaking Changes
None for end users. The pdfjs-dist pin may require attention if you have a local package-lock.json with a conflicting version.
Migration Guide
If you're running a forked version and see react-pdf worker errors, check that pdfjs-dist in your node_modules matches the version react-pdf declares as a peer dependency. Run npm ls pdfjs-dist to check for duplicates or mismatches.
FAQ
Why did the PDF tools break silently with no obvious error?
react-pdf loads its worker script dynamically at runtime. When pdfjs-dist is the wrong version, the worker initializes but fails to process documents, producing vague or no error output in the UI. The mismatch only surfaces clearly in browser DevTools network or console logs.
Why does react-pdf need blob: in the CSP connect-src?
react-pdf constructs its worker as a blob URL internally. If your CSP doesn't allow blob: in connect-src, the browser blocks that request and the PDF never loads. The error message 'Unexpected server response' is misleading because it's actually a CSP rejection, not a server issue.
How does the zero-CLS banner work without React?
A small inline script in <head> reads localStorage synchronously before the browser paints anything. If the user has already dismissed the banner, a class is added to the root element immediately, so CSS hides the banner space before layout is calculated. No flicker, no shift.
Does the locale punctuation fix affect translation keys or just display text?
Only display text values were changed. Translation keys are untouched. The 334 em-dashes were replaced with standard hyphens in the string values across 18 locale JSON files.