Skip to content

fix: use named imports for js-yaml v5 ESM compatibility - #10676

Merged
laske185 merged 1 commit into
developfrom
fix/js-yaml-esm-import
Aug 13, 2026
Merged

fix: use named imports for js-yaml v5 ESM compatibility#10676
laske185 merged 1 commit into
developfrom
fix/js-yaml-esm-import

Conversation

@deleonio

Copy link
Copy Markdown
Contributor

Summary

The 01 - Publish workflow (#878) crashes on Node 24 with:

SyntaxError: The requested module 'js-yaml' does not provide an export named 'default'
    at scripts/update-publiccode.mjs:3

Root cause

js-yaml was bumped from 4.x → 5.2.3 in a recent dependency update (chore: update dependencies and lock file). Version 5.x ships a real ESM build (dist/js-yaml.mjs) with named exports only — there is no export default. The default import import yaml from 'js-yaml' worked under 4.x (CJS interop) but crashes under 5.x.

Additionally, js-yaml was not declared as a dependency in any package.json — it only resolved as a hoisted transitive dependency via stylelint → cosmiconfig → js-yaml (surviving only because .npmrc sets shamefully-hoist=true). This masked the version bump entirely.

Changes

  • scripts/update-publiccode.mjs: Switch from default import (import yaml from 'js-yaml') to named imports (import { dump, load } from 'js-yaml') — the load/dump signatures are unchanged from 4.x
  • package.json: Declare js-yaml@5.2.3 as explicit devDependency so the version is tracked and not at the mercy of transitive resolution
  • pnpm-lock.yaml: Updated lockfile (no new download — 5.2.3 was already in the store)

Verification

node scripts/update-publiccode.mjs runs successfully (previously crashed immediately)
pnpm format — all files pass

js-yaml was bumped from 4.x to 5.2.3 in a recent dependency update.
v5 ships a real ESM build with named exports only (no default export),
which breaks the default import in scripts/update-publiccode.mjs on
Node 24, crashing the publish workflow.

- Switch to named imports (load, dump) for js-yaml v5
- Declare js-yaml as explicit devDependency (was undeclared transitive dep)
@deleonio
deleonio requested review from BF150 and laske185 August 13, 2026 07:05
@deleonio deleonio added the release:ignore PR wird vom Release-Changelog ausgeschlossen. label Aug 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Preview deployed to GitHub Pages: https://public-ui.github.io/kolibri/pr-10676/3992fb3/
Commit: 3992fb3

@github-actions

Copy link
Copy Markdown
Contributor

📸 Visual Test Reports

Theme Report
theme-bwst Open report
theme-default Open report
theme-desy Open report
theme-ecl Open report
theme-kern Open report
test-tag-name-transformer Open report

Run: https://github.com/public-ui/kolibri/actions/runs/31676217109

@laske185
laske185 merged commit 2f6699c into develop Aug 13, 2026
18 of 19 checks passed
@laske185
laske185 deleted the fix/js-yaml-esm-import branch August 13, 2026 07:31
@publicuibot publicuibot Bot locked and limited conversation to collaborators Aug 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release:ignore PR wird vom Release-Changelog ausgeschlossen.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants