fix(resume): preload pdfjs worker so Vercel bundles it and parsing wo…#95
fix(resume): preload pdfjs worker so Vercel bundles it and parsing wo…#95RikepilB wants to merge 1 commit into
Conversation
…rks in prod Production PDF parsing failed with: Setting up fake worker failed: "Cannot find module '.../pdfjs-dist/legacy/build/pdf.worker.mjs'" pdfjs resolves its worker via a runtime-computed import that Vercel's file tracer cannot follow, so pdf.worker.mjs never made it into the deployed bundle. Importing the worker module eagerly (before pdf-parse loads) fixes both halves: the literal specifier gets the file traced into the bundle, and the import sets globalThis.pdfjsWorker, which pdfjs prefers over dynamically importing workerSrc. pdfjs-dist is pinned exact (5.4.296) to match pdf-parse's transitive dependency so the preloaded worker and the parser are the same build. Also gitignore playwright-report/ and .playwright-mcp/ artifacts.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR introduces PDF.js support for resume text extraction with worker preload and Node.js canvas polyfilling, while also expanding the project's .gitignore to exclude Playwright test artifacts. The changes address Vercel/Node runtime incompatibilities with missing DOM globals and worker bundles. ChangesPDF.js Integration for Text Extraction
Test Artifact Ignore Patterns
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Comment |
…rks in prod
Production PDF parsing failed with:
Setting up fake worker failed: "Cannot find module '.../pdfjs-dist/legacy/build/pdf.worker.mjs'"
pdfjs resolves its worker via a runtime-computed import that Vercel's file tracer cannot follow, so pdf.worker.mjs never made it into the deployed bundle. Importing the worker module eagerly (before pdf-parse loads) fixes both halves: the literal specifier gets the file traced into the bundle, and the import sets globalThis.pdfjsWorker, which pdfjs prefers over dynamically importing workerSrc.
pdfjs-dist is pinned exact (5.4.296) to match pdf-parse's transitive dependency so the preloaded worker and the parser are the same build.
Also gitignore playwright-report/ and .playwright-mcp/ artifacts.
Summary by CodeRabbit
Release Notes
New Features
Improvements