Skip to content

Fix pdf-parse DOMMatrix error on Vercel - #15

Merged
Abdullah-dev0 merged 8 commits into
mainfrom
fix/vercel-pdf-dommatrix
Aug 21, 2026
Merged

Abdullah-dev0 merged 8 commits into
mainfrom
fix/vercel-pdf-dommatrix

Conversation

@Abdullah-dev0

Copy link
Copy Markdown
Owner

Summary

  • load CanvasFactory before PDFParse and pass it to the parser
  • externalize pdf-parse and @napi-rs/canvas for the Next.js server runtime
  • log PDF-processing failures before marking uploads as failed

This addresses the ReferenceError: DOMMatrix is not defined regression introduced after dependency upgrade PR #14.

Validation

  • npm install (no lockfile changes)
  • npm run typecheck ✅
  • confirmed CanvasFactory and PDFParse import successfully in Node.js ✅
  • npm run build compiled successfully without the DOMMatrix error; page-data collection then stopped because the local validation environment does not have MISTRAL_API_KEY
  • full lint is blocked locally by an unrelated unrs-resolver optional native binding installation error on Windows

Reference: https://github.com/mehmet-kozan/pdf-parse/blob/main/docs/troubleshooting.md

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
texttalk Ignored Ignored Aug 21, 2026 2:04pm

@Abdullah-dev0
Abdullah-dev0 merged commit a1f3494 into main Aug 21, 2026
3 of 4 checks passed
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.

1 participant