cncf / cncf/endusers

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

Open Beginner friendly
#123 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
0
Forks
1
Avg merge
2d 22h
Merged PRs (30d)
12

Description

## 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](https://github.com/castrojo/endusers/actions/runs/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:

```diff
--- 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)*

Contributor guide

Open the contributing guide

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.