Skip to content

chore(deps): update node.js to v22.22.2#789

Open
renovate[bot] wants to merge 2 commits into
masterfrom
renovate/node-22.x
Open

chore(deps): update node.js to v22.22.2#789
renovate[bot] wants to merge 2 commits into
masterfrom
renovate/node-22.x

Conversation

@renovate

@renovate renovate Bot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Update Change
node (source) patch 22.22.022.22.2

Release Notes

nodejs/node (node)

v22.22.2

Compare Source

v22.22.1: 2026-03-05, Version 22.22.1 'Jod' (LTS)

Compare Source

Notable Changes
Commits

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@olexs

olexs commented Mar 11, 2026

Copy link
Copy Markdown
Owner

@claude The Renovate PR build failed (workflow run: 22937952615).

Please analyze the CI failure and implement a fix if possible.

Workflow run: https://github.com/olexs/pdf-assembler/actions/runs/22937952615

@claude

claude Bot commented Mar 11, 2026

Copy link
Copy Markdown

Claude finished @olexs's task in 13m 32s —— View job


CI Failure Analysis

  • Fetch CI failure details
  • Analyze failure root cause
  • Implement fix (see findings below)

Findings

Both the macOS and Windows builds fail at the "Run E2E tests" step, with all 7 E2E tests timing out with the same error:

TimeoutError: page.waitForSelector: Timeout 30000ms exceeded.
  - waiting for locator('#input-list .list-group-item') to be visible

This means the Electron app launches but no input files are ever loaded into the file list.

Key observations:

  • ✅ Lint passes
  • ✅ Unit tests pass (83/83)
  • npm run package / webpack build succeeds with no errors
  • ❌ All 7 E2E tests fail consistently on both platforms
  • 🔇 No console output from the Electron app (no "Window opened", no "[log]" messages) — suggesting a renderer-level crash or unhandled rejection is silently swallowing errors

Root Cause Assessment

This failure is NOT caused by the Node.js 22.22.0 → 22.22.1 patch update in this PR. The .node-version file only affects the build toolchain (npm, webpack, electron-forge), not the Electron runtime which bundles its own Node.js version.

The failure is almost certainly a pre-existing regression from master, introduced by PR #779 (tempy v3.x ESM update, merged as 78967cf). That PR:

  1. Updated tempy to v3.1.2 (now ESM-only)
  2. Added conditionNames: ['import', 'require', 'node', 'default'] to both webpack configs to support ESM module resolution

The most likely root causes (requires local debugging to confirm):

  1. fs alias circular dependency: The renderer webpack config has alias: { fs: 'pdfkit/js/virtual-fs.js' }. When pdfkit/js/virtual-fs.js internally calls require('fs'), webpack may resolve that to itself (circular), resulting in fs.existsSync being undefined — causing a silent TypeError in preprocessor.ts:25 before any files are processed.

  2. ESM interop in renderer bundle: [email protected] and [email protected] are ESM-only. The conditionNames change makes webpack resolve them via the import condition, but the ESM→CJS bundling in the renderer context may cause a runtime failure in generateInputThumbnail (renderer.ts:149).

  3. imageSizeFromFile from [email protected]: This dependency may also be ESM and may have a conflict with the webpack bundling context.

What This Means for This PR

The Node.js 22.22.1 update itself is a clean, safe patch update. The CI failure is a pre-existing blocker in master that will affect any PR branched from the current master until the underlying E2E issue is fixed.

Suggested Next Steps

  1. Verify master is also broken: Run CI on master directly to confirm the pre-existing failure (use /rerun-ci on a master PR or check the latest master CI run).

  2. Fix the E2E issue on master — the likely fix is to address the webpack fs aliasing conflict. One approach:

    // webpack.renderer.config.js — scope the fs alias only to PDFKit 
    // OR mark fs as external to use the real Node.js fs:
    externals: {
      'sharp': 'commonjs sharp',
      // Remove the fs alias and instead ensure PDFKit fonts load another way
    }

    Another option is to add explicit try/catch around fs operations or replace fs.existsSync with a native Node.js require('fs') call using __non_webpack_require__.

  3. Once master E2E is fixed, this Renovate PR can be re-run and should merge cleanly.

⚠️ I cannot implement the fix directly in this Renovate PR since: (a) this is a dependency-only PR and fixes should go to master first, and (b) the exact root cause requires local debugging to confirm before changing webpack configuration.

View workflow run

@renovate renovate Bot force-pushed the renovate/node-22.x branch from 67dfce1 to 265aa75 Compare March 24, 2026 21:11
@renovate renovate Bot changed the title chore(deps): update node.js to v22.22.1 chore(deps): update node.js to v22.22.2 Mar 24, 2026
@olexs

olexs commented Mar 24, 2026

Copy link
Copy Markdown
Owner

@claude The Renovate PR build failed (workflow run: 23512453959).

Please analyze the CI failure and implement a fix if possible.

Workflow run: https://github.com/olexs/pdf-assembler/actions/runs/23512453959

@claude

claude Bot commented Mar 24, 2026

Copy link
Copy Markdown

Claude finished @olexs's task in 4m 18s —— View job


CI Failure Analysis

  • Fetch CI failure details
  • Analyze failure root cause
  • Implement fix

Root Cause

The tempy 3.x PR (#779) introduced webpack.renderer.config.js with a webpack alias:

resolve: {
  alias: { fs: 'pdfkit/js/virtual-fs.js' }
}

This alias redirects all import fs from 'fs' imports in the renderer bundle to PDFKit's virtual filesystem (which only has readFileSync/writeFileSync — no existsSync, promises, etc.).

This broke preprocessor.ts, renderer.ts, and pdfGenerator.ts which all do real filesystem operations via fs. When preprocessInputFiles() is called with input files, fs.existsSync() is undefined, causing a silent TypeError that prevents files from appearing in the input list — hence the E2E timeout.

Fix Applied

Changed import fs from 'fs'import fs from 'node:fs' in the three affected renderer-side files (commit 58aafd7):

  • src/preprocessor.ts
  • src/renderer.ts
  • src/pdfGenerator.ts

The node: prefix bypasses webpack's alias resolution and uses the real Node.js fs module. PDFKit's internal bare require('fs') references (needed for virtual font loading) are unaffected.
|

The webpack renderer config added by the tempy 3.x update aliases bare
'fs' imports to pdfkit/js/virtual-fs.js (needed for PDFKit font loading).
This broke all real filesystem operations in the renderer bundle since
virtual-fs only implements readFileSync/writeFileSync.

Using 'node:fs' bypasses the alias and resolves to the real Node.js fs
module, while PDFKit's internal bare require('fs') references continue
to use the virtual filesystem.

Co-authored-by: Olex S. <[email protected]>
@renovate

renovate Bot commented Mar 25, 2026

Copy link
Copy Markdown
Contributor Author

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

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