Fix asciidoctor v4 ESM import to unbreak Publish to website - #640
Merged
Conversation
asciidoctor 4.x removed the default export and the factory-function API: the old `import asciidoctor from 'asciidoctor'` + `asciidoctor().convert()` now throws "does not provide an export named 'default'" at module load, so every Publish to website run has failed since the v4 bump landed. Switch to the v4 named `convert` export and await its two call sites (both already inside async callbacks). v4's convert produces byte-for-byte identical HTML to v3 on the learning-path articles, so published output is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H1niVBoyczk8mXe9L7Fnzv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What broke
The Publish to website workflow has failed on every push to
mainsince theasciidoctordependency was bumped from 3.x to 4.0.2 (Dependabot #628, merged 2026-07-14). The build dies at module load with:asciidoctor 4.x is a breaking API change: it dropped the default export and the
asciidoctor()factory function in favor of named ESM exports (convert,load, etc.), andconvertis now async.As a result the learning-path content has not republished to innersourcecommons.org for roughly two months.
The fix
convertexport instead of the removed default factory.awaitthe twoconvert(...)call sites (both already sit insideasynccallbacks, so no other restructuring is needed).Why the output is safe
v4's
convertproduces byte-for-byte identical HTML to v3 on the learning-path articles (verified by converting the same article with bothasciidoctor@3.0.4andasciidoctor@4.0.2and diffing — no difference), so the generated site content is unchanged. This keeps the Dependabot v4 bump in place rather than reverting it.Verification
asciidoctor@4.0.2resolves the{ convert }import and converts on Node 18 (the workflow's runtime).node --checkpasses on the edited script.🤖 Generated with Claude Code
https://claude.ai/code/session_01H1niVBoyczk8mXe9L7Fnzv