After updating PDF Embedder, are you seeing the error “The API version does not match the Worker version”? This happens when a caching or minification plugin is still serving the old version of the plugin’s JavaScript files after an update. The viewer loads the new API alongside a cached worker from the previous version, and they no longer match.
This guide explains how to clear the mismatch and stop it from happening on every future update.
Resolving the error
Clear your site cache
Open your caching plugin and purge all cached files. If your caching tool manages JavaScript optimisation separately (script combining or minification), clear that cache specifically.
Clear your browser cache
After clearing the server-side cache, do a hard reload in your browser:
- Windows/Linux:
Ctrl + Shift + R - Mac:
Cmd + Shift + R
The error should be gone after both layers are flushed.
Preventing the error on future updates
The error comes up because the caching plugin is aggregating or caching the plugin’s JavaScript files. Excluding those file paths from your cache prevents version mismatches on every future update.
Add the following paths to your caching or minification plugin’s exclusion list:
Free version paths:
/wp-content/plugins/pdf-embedder/js/all-pdfemb-basic-4.6.24.min.js/wp-content/plugins/pdf-embedder/js/pdfjs/pdf-4.6.4.min.js/wp-content/plugins/pdf-embedder/js/pdfjs/pdf-4.6.4.worker.min.js
Premium version paths:
/wp-content/plugins/PDFEmbedder-premium/js/all-pdfemb-premium-5.0.2.min.js/wp-content/plugins/PDFEmbedder-premium/js/pdfjs/pdf-5.0.2.min.js/wp-content/plugins/PDFEmbedder-premium/js/pdfjs/pdf-5.0.2.worker.min.js
Secure version paths:
/wp-content/plugins/PDFEmbedder-premium-secure/js/all-pdfemb-premium-5.0.2.min.js/wp-content/plugins/PDFEmbedder-premium-secure/js/pdfjs/pdf-5.0.2.min.js/wp-content/plugins/PDFEmbedder-premium-secure/js/pdfjs/pdf-5.0.2.worker.min.js
After adding the exclusions, flush the cache again and do a hard browser reload.
The version numbers in these paths change with each plugin update. For a permanent exclusion that does not need updating, use a pattern-based rule that matches the plugin folder path rather than specific filenames. See Using Caching or Minifying Plugins for how to set that up.
No caching plugin installed?
If you are not using a caching plugin and the error still appears, the scripts are cached in the browser only. A hard reload (Step 2 above) is all that is needed.