The Last Spike Online / 19 July 2026

The PDF would not render because the worker 'was there' — it was just being served incorrectly

The rulebook PDF-worker failure was misleading because the file existed. The browser needed a JavaScript worker with the correct MIME type, while an older broken copy could still return from cache.

2 min read
The Last Spike Online
PDFWebWorkerMIMEcache

Situation

After integrating the localized PDF viewer, the rulebook appeared blank or failed in some environments. The worker file was present in the build, which initially made the problem look like a library defect. The network panel showed otherwise: the way the worker was served did not satisfy what the browser accepted as an executable worker resource.

Approach

I checked the worker URL, Content-Type and cache behaviour. The asset was served as actual JavaScript, then versioning and refresh behaviour forced browsers to stop reusing the earlier broken worker. We also made render failures visible so the viewer could no longer fail as a silent empty state.

Outcome

The rulebook rendered reliably in supported browsers, and a future failure of the same kind would produce a diagnosable message. The fix crossed the static-asset pipeline, HTTP metadata and browser cache; the PDF library itself was not the root cause.