Skip to content

Fix ERR_REQUIRE_ESM crash-loop: bump base image Alpine 3.19 -> 3.22 (…#84

Merged
woytekbode merged 1 commit into
C2gl:mainfrom
woytekbode:pr/c2gl-fix-node-1.2.4.1
Jul 15, 2026
Merged

Fix ERR_REQUIRE_ESM crash-loop: bump base image Alpine 3.19 -> 3.22 (…#84
woytekbode merged 1 commit into
C2gl:mainfrom
woytekbode:pr/c2gl-fix-node-1.2.4.1

Conversation

@woytekbode

Copy link
Copy Markdown
Collaborator

Description

Fixes the startup crash-loop in addon 1.2.4: upstream tududi v1.2.4 added jose v6 (ESM-only), which is require()'d at startup — this needs Node ≥ 20.19 / ≥ 22.12, but the Alpine 3.19 base image ships Node 20.15.1. Bumps the base image to Alpine 3.22 (Node 22.16, matching upstream's node:22-alpine).

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
    • Referenced the bug
  • New feature (non-breaking change which adds functionality)
    • was there a feature request, if yes, linked
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • CI/CD changes
  • Bump Dependancies

Changes Made

  • tududi-addon-dev/build.yaml: base image Alpine 3.19 → 3.22 (both arches). 3.19 is EOL and no longer rebuilt by HA docker-base (currently built: 3.22/3.23/3.24); its Node 20.15.1 cannot require() the ESM-only jose v6 added in upstream v1.2.4.
  • tududi-addon-dev/config.yaml: version 1.2.41.2.4.1 (addon-level patch, still wraps tududi v1.2.4).
  • tududi-addon-dev/CHANGELOG.md: new 1.2.4.1 entry.

Testing

  • Local testing completed
  • Add-on builds successfully
  • Tested in Home Assistant
  • No breaking changes confirmed

Add-on Affected

  • Development addon (tududi-addon-dev)
  • Stable addon (tududi-addon)
  • Repository configuration
  • CI/CD workflows

Checklist

  • Self-review of code completed
  • Changes generate no new warnings
  • Documentation updated (if needed)
  • Changelog updated (if needed)
  • Version number updated (if needed)

Screenshots (if applicable)

Additional Notes

  • Crash signature: Error [ERR_REQUIRE_ESM]: require() of ES Module /app/node_modules/jose/dist/webapi/index.js from /app/backend/modules/oidc/service.js — hit regardless of OIDC configuration.
  • Root cause verified against chrisvel/tududi@v1.2.4 (jose ^6.0.0 in package.json); v1.1.0-dev.14 had no jose dependency, which is why the previous image worked. Upstream uses node:22-alpine, so they never see this.
  • Build/HA testing not yet done — will verify once the builder publishes the image. After merge, run the builder workflow targeting dev to publish ghcr.io/c2gl/tududi-addon-dev:1.2.4.1.
  • Follow-up suggestion: the stable addon also pins Alpine 3.19; unaffected today (wraps 0.89.0) but will hit the same crash on any future bump to ≥1.2.x.

…addon 1.2.4.1)

- build.yaml: base image Alpine 3.19 (Node 20.15.1) -> 3.22 (Node 22.16).
  Upstream v1.2.4 added jose v6 (ESM-only), require()'d at startup in
  backend/modules/oidc/service.js; require(esm) needs Node >= 20.19 or >= 22.12.
- config.yaml: version 1.2.4 -> 1.2.4.1
- CHANGELOG.md: add 1.2.4.1 entry
@woytekbode
woytekbode merged commit 8a95aff into C2gl:main Jul 15, 2026
3 checks passed
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