fix: bump pdfkit to 0.20.2 for tracer-safe standard fonts - #3550
Closed
mrowe wants to merge 1 commit into
Closed
Conversation
pdfkit 0.20.0/0.20.1 mapped '#standard-fonts/*' to .cjs under the 'require' condition but .mjs under 'default'. Node resolves the .cjs files at runtime, while file tracers and bundlers (e.g. @vercel/nft behind Next.js standalone output) resolve the .mjs twins - so traced deployments omit the modules the Node build actually loads and the first render throws: Cannot find module '.../pdfkit/js/standard-fonts/Helvetica.cjs' pdfkit 0.20.2 (foliojs/pdfkit#1782) resolves the subpath to one file under every condition, so traced output matches runtime. Patch-only upgrade, no API change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013Z4s94hfd1MWA6TnLmRXEb
|
@mrowe is attempting to deploy a commit to the diegomura Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 8be3fe3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@mrowe why this was closed? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Bumps the exact
pdfkitpin in@react-pdf/fontand@react-pdf/rendererfrom0.20.1to0.20.2, with a patch changeset for both packages. The lockfile regeneration also let yarn re-normalize one previously merged babel entry.Why
pdfkit 0.20.0/0.20.1 map
#standard-fonts/*to.cjsunder therequirecondition but.mjsunderdefault. Node resolves the.cjsfiles at runtime, while file tracers and bundlers — e.g.@vercel/nft, which builds Next.jsoutput: 'standalone'deployments — resolve the.mjstwins. The traced output therefore omits the modules the Node build actually lazy-loads, the build succeeds, and the first server-side render throws:Helvetica is the default font, so any document without registered fonts hits this immediately. We hit this in production after upgrading
@react-pdf/renderer4.5.1 → 4.9.0 (the 4.8.0 fork→upstream pdfkit swap): guest receipt PDFs 500'd in the deployed container while local dev and the build itself were green.pdfkit 0.20.2 fixes this upstream (foliojs/pdfkit#1782) by resolving the subpath to one file under every condition, so tracers pack what runtime loads.
0.20.1 → 0.20.2is patch-only with no API change.Verified in our Next.js standalone deployment: with 0.20.2 (via npm
overrides) the traced output contains all 14standard-fonts/*.cjsfiles and server-side rendering works; with 0.20.1 it contains none of them.Note this is unrelated to #3532 (
TypeError: Invalid URLfromimport.meta.urlunder ESBuild-to-CJS transpilation) — different mechanism, not fixed by this bump.🤖 Generated with Claude Code
https://claude.ai/code/session_013Z4s94hfd1MWA6TnLmRXEb