Skip to content

Hold mdast-util-to-markdown at 2.1.2 in the npm and bun scaffolds - #277

Merged
mjunaidca merged 1 commit into
mainfrom
fix/276-npm-bun-mdast-bound
Oct 1, 2026
Merged

mjunaidca merged 1 commit into
mainfrom
fix/276-npm-bun-mdast-bound

Conversation

@mjunaidca

@mjunaidca mjunaidca commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #276.

Problem

Manager acceptance (npm) and Manager acceptance (bun) have been failing on main since 2026-09-27, and they are what blocks #275's CI. On a fresh npm or bun scaffold, the site build fails with RangeError: Maximum call stack size exceeded, raised between fumadocs-core/dist/mdx-plugins/stringifier.js and mdast-util-to-markdown/lib/handle/strong.js. #275 did not cause this. Re-running main's last green run (35607538919, e3ab335) fails the npm job the same way, and so do both walks run locally on an unmodified main.

The cause is mdast-util-to-markdown@2.1.3, published 2026-09-27. In that release, bold and italic are written only through a handler's attention property. The MDX stringifier in fumadocs-core@16.15.4, the version the scaffold pins, wraps every handler without copying that property. containerPhrasing therefore calls the wrapper, the wrapper calls strong, and strong calls containerPhrasing again, without end. Upstream tracks this as fuma-nama/fumadocs#3604. It is fixed in fumadocs-core 16.15.15 (fuma-nama/fumadocs@7b83e88). The pnpm scaffold kept passing because its committed lockfile holds 2.1.2. The npm and bun scaffolds ship no lockfile (decision 25), so they resolved 2.1.3. #276 has the full evidence, including a control that changes only this one version.

Solution

transformManifest now writes "overrides": { "mdast-util-to-markdown": "2.1.2" } into the npm and bun manifests. Both managers read the field. The value lives in one constant in manager.ts, with a comment that names the upstream issue and says when to remove it. A JSON manifest cannot carry that comment to the adopter, so a short npm bun paragraph in the scaffold README explains the override and when to delete it. The pnpm scaffold has not changed.

I chose this over moving the scaffold to Fumadocs 16.15.15 because that move covers eleven patch releases of shell changes. They include tabs regrouped by root folder, the search dialog rebuilt as a combobox, components/ui/scroll-area removed, and sideEffects declared. Following #217, the move would also mean re-checking the four behaviours the scaffold cites by version and running the browser suites. That is maintenance work that should be its own change, not part of unblocking CI.

Behaviour

  • On a new npm or bun scaffold, install and build work again, with mdast-util-to-markdown resolving to 2.1.2.
  • A pnpm scaffold has the same bytes as before.
  • init-manager.integration.test.ts asserts the bound in the emitted npm and bun manifests and READMEs. It also asserts that no override is emitted for pnpm, and that the pnpm lockfile holds only 2.1.2. It fails once the site template's fumadocs-core reaches 16.15.15, and the failure message says to remove the bound and its README paragraph. The Fumadocs move therefore cannot leave a stale pin in adopters' repositories.
  • Changeset: @panaversity/ksor patch, with a note telling existing npm and bun adopters what to add if their build fails.

Verified locally (Node 24.18, npm 11.16, bun 1.3.6, pnpm 11.22)

Check Result
node scripts/manager-acceptance.mjs npm, on main and then on this branch fails with the RangeError, then ok
node scripts/manager-acceptance.mjs bun, on main and then on this branch fails with the RangeError, then ok
New test with the fix reverted fails: npm: expected undefined to deeply equal { 'mdast-util-to-markdown': '2.1.2' }
New test with the template moved to fumadocs-core 16.15.15 (reverted afterwards) fails with the "drop the bound" message
pnpm lint:ci, fmt:ci, typecheck, guard, check:corpus, test:unit, build, publint all ok
pnpm test:integration 66 files, 750 passed, 34 skipped
pnpm changeset status --since=origin/main @panaversity/ksor patch

Not run locally: the browser suites (pnpm test:e2e) and pnpm test:db. CI ran both on this branch, in run 36862647661, and every job passed, including both manager walks.

🤖 Generated with Claude Code

mdast-util-to-markdown 2.1.3 (2026-09-27) writes bold and italic only through
a handler's `attention`. The MDX stringifier of fumadocs-core 16.15.4, which
the site pins, wraps every handler without that property, so the site build
recursed until the stack overflowed (fuma-nama/fumadocs#3604, fixed in
fumadocs-core 16.15.15). The pnpm scaffold kept building because its committed
lockfile holds 2.1.2. The npm and bun scaffolds ship no lockfile, so a fresh
install took 2.1.3, and both manager walks have failed on main since then.

The npm and bun manifests now carry `overrides` pinning 2.1.2, and both
managers honour it. JSON cannot hold a comment, so the README explains the
override to the adopter. The integration test asserts the bound on the emitted
bytes, and checks that the pnpm lockfile holds the same version. It also fails
once the site moves to a fumadocs-core that has the fix, so that the bound
and its README paragraph are removed in that same change.

Closes #276.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mjunaidca
mjunaidca marked this pull request as ready for review October 1, 2026 12:39
@mjunaidca
mjunaidca merged commit 7d2e28a into main Oct 1, 2026
12 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.

npm and bun scaffold builds overflow the stack: mdast-util-to-markdown 2.1.3 breaks fumadocs-core 16.15.4's MDX stringifier

1 participant