Skip to content

fix: hastscript v9 named-export break in llms-txt rehype plugin#3351

Merged
anegg0 merged 1 commit into
masterfrom
fix/llms-txt-hastscript-export
Jun 10, 2026
Merged

fix: hastscript v9 named-export break in llms-txt rehype plugin#3351
anegg0 merged 1 commit into
masterfrom
fix/llms-txt-hastscript-export

Conversation

@anegg0

@anegg0 anegg0 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes a regression in the llms-txt build caused by the hastscript 6.0.0 → 9.0.1 bump. hastscript v7+ is ESM-only and replaced its default export with named exports ({ h, s }), so const h = require('hastscript') returned the module namespace object instead of the h function. Every h(...) call in the rehype-llms-cleanup plugin then threw "h is not a function", and docusaurus-plugin-llms-txt skipped affected routes (for example /stylus/reference/stylus-toml-reference) with "Failed to convert HTML to Markdown".

The fix destructures the named export:

-const h = require('hastscript');
+const { h } = require('hastscript');

Extracted from #3349 so it can merge to master independently of the Inside Arbitrum Nitro docs rewrite. master currently ships hastscript@^9 with the old import, so this fixes a live build warning on master.

Document type

  • Codebase changes

Checklist

  • My code follows the existing code style and conventions
  • I have tested my changes locally with yarn build
  • I have verified that my changes don't break the build

Additional Notes

Verified with a full yarn build: docusaurus-plugin-llms-txt reports "Plugin completed successfully — processed 285 documents", and the "h is not a function" / "Failed to convert HTML to Markdown" warnings are gone.

@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
arbitrum-docs Ready Ready Preview Jun 10, 2026 7:58pm

Request Review

@anegg0 anegg0 merged commit cda37e5 into master Jun 10, 2026
9 checks passed
@anegg0 anegg0 deleted the fix/llms-txt-hastscript-export branch June 10, 2026 20:18
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.

2 participants