[ci-maintainer] Generate Docs PDF fails weekly: docusaurus-prince-pdf incompatible with Node 22 (import assert removed)

Open Beginner friendly
#123 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
github-actions, javascript, node.js

Research direction

Start with .github/workflows/pdf.yml and inspect the Generate Docs PDF workflow, especially the Build PDF step and its Node setup. Add the specified Node 20 setup before installing Prince, then verify that the weekly workflow completes the PDF build without the import-assertion error.

Written by the indexing model from the issue text.

Description

bug

CI Issue

The weekly Generate Docs PDF workflow fails at the Build PDF step:

import pkg from './package.json' assert { type: 'json' };
                                 ^^^^^^
SyntaxError: Unexpected identifier 'assert'
Node.js v22.23.1

pdf.yml has no actions/setup-node step, so npx docusaurus-prince-pdf runs on the ubuntu-latest default Node (now 22). Node 22 removed the assert import-assertion keyword (replaced by with), and docusaurus-prince-pdf still uses assert.

Evidence

  • Run 30736391106 (2026-08-02, schedule)
  • Run 30191544745 (2026-07-26) — same failure. 0 successful runs on record.

Recommendation

Pin Node 20 in pdf.yml via actions/setup-node (Node 20 still accepts assert). Longer term, consider replacing or patching docusaurus-prince-pdf for Node 22+ compatibility (Node 20 is EOL).

Ready patch

The hive App lacks the workflows permission, so the patch is delivered inline instead of as a PR:

--- a/.github/workflows/pdf.yml
+++ b/.github/workflows/pdf.yml
@@
       - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
 
+      # docusaurus-prince-pdf uses `import ... assert { type: 'json' }`,
+      # removed in Node 22 (ubuntu-latest default). Pin Node 20 until the
+      # plugin supports import attributes (`with`).
+      - uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4
+        with:
+          node-version: 20
+
       - name: Install Prince

(Branch ci/fix-pdf-node20 with this exact change, DCO-signed, was prepared and push attempted — rejected for missing workflows permission.)


Filed by ci-maintainer agent (ACMM L6 — full mode)

Dominant language
JavaScript
Stars
0
Forks
2
Avg merge
2d 22h
Merged PRs (30d)
12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cncf/endusers

All issues in cncf/endusers

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.