react-pdf-kit-nextjs14-pdfjs-override — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited react-pdf-kit-nextjs14-pdfjs-override (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Use this skill when: a project is on Next.js 14 and either wants to use @react-pdf-kit/viewer v2 or is hitting a pdfjs-dist module-load error such as
TypeError: Object.defineProperty called on non-objectduring a Next.js 14 build or runtime.
@react-pdf-kit/viewer@^2.0.0 does not work on Next.js 14. Next.js 14's webpack build has an ESM interop bug that breaks pdfjs-dist@5's module-load path, and v2 has no supported workaround for it. Pinning pdfjs-dist to v4 is not a reliable fix for v2 on Next.js 14 — do not rely on it. Support for Next.js 14 is being worked on upstream but is not available today.
Pick one of the two supported paths below.
Next.js 15 with Turbopack runs @react-pdf-kit/viewer v2 with pdfjs-dist@5 out of the box — no override needed.
// package.json
{
"scripts": {
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start"
}
}react-pdf-kit-nextjs-app-router (AppRouter) or react-pdf-kit-nextjs-pages-router (Pages Router). No pdfjs-dist install or workerUrl is required for the default case.
This is the path to prefer for any project that can move off Next.js 14.
If upgrading is not an option yet, do not use @react-pdf-kit/viewer@2 on Next.js 14. Use the legacy @pdf-viewer/react package instead, which supports the Next.js 14 + webpack toolchain.
pnpm remove @react-pdf-kit/viewer
pnpm add @pdf-viewer/reactFollow that package's own documentation for the provider chain and pdfjs-dist configuration. Plan to migrate to @react-pdf-kit/viewer v2 once the project is on Next.js 15.
next build and next dev --turbopackboth succeed, and a page renders the first PDF page with no Object.defineProperty or Promise.withResolve errors.
@react-pdf-kit/viewer is no longer a dependency, theNext.js 14 build succeeds with @pdf-viewer/react, and a PDF renders.
react-pdf-kit-nextjs-app-router andreact-pdf-kit-nextjs-pages-router: apply after upgrading to Next.js 15.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.