Skip to content

fix(context): ignore non-string frontmatter title/description#91

Merged
moshest merged 1 commit into
mainfrom
claude/svelte-publish-error-cRsIf
May 30, 2026
Merged

fix(context): ignore non-string frontmatter title/description#91
moshest merged 1 commit into
mainfrom
claude/svelte-publish-error-cRsIf

Conversation

@moshest
Copy link
Copy Markdown
Member

@moshest moshest commented May 30, 2026

Problem

The scheduled publish-all job failed for npm/svelte@5.56.0 with:

FAILED npm/svelte@5.56.0: Too few parameter values were provided

All other packages built/published fine.

Root cause

Too few parameter values were provided is a better-sqlite3 error: when a positional argument to a prepared statement's .run() is a plain JS object, better-sqlite3 interprets it as a named-parameters bind map, consuming one slot — leaving fewer anonymous values than ? placeholders.

The offending object originated in one Svelte 5.56.0 doc file, documentation/docs/03-template-syntax/11-declaration-tags.md, whose frontmatter is:

---
title: {let/const ...}
---

{let/const ...} is unquoted and is valid YAML flow-mapping syntax, so the parser produced the object { "let/const ...": null } instead of a string. extractFrontmatter blind-cast the parsed YAML, and parseMarkdown then used that truthy object as docTitle, which flowed into insertChunk.run(...) (6 placeholders) at package-builder.ts:117 and crashed the build.

Other svelte titles like {#if ...} / {@render ...} start with {#/{@, which YAML rejects as flow maps and keeps as strings — which is why only this one package failed.

Fix

extractFrontmatter now keeps title/description only when they are actually strings, otherwise drops them so docTitle falls back to the filename-derived title.

Validation

  • Reproduced the crash before the fix; after the fix registry build svelte 5.56.0Built: 284 sections, 68643 tokens (exit 0).
  • @neuledge/context tests: 158 passed (added a regression test that fails on old code, passes on fix).
  • Lint and build pass for @neuledge/context.
  • Changeset added (@neuledge/context patch).

https://claude.ai/code/session_01Dk6cdQKeX3Lr1eDoL1uTXM


Generated by Claude Code

Some docs (e.g. Svelte 5's template-syntax pages) have unquoted YAML
frontmatter titles like `{@render ...}` or `{let/const ...}` that the
YAML parser reads as a flow-mapping object rather than a string. That
object propagated into a section's docTitle and was then passed to a
better-sqlite3 prepared statement as a positional argument, where it was
interpreted as a named-parameters bind object — leaving fewer values
than `?` placeholders and crashing the build with "Too few parameter
values were provided".

extractFrontmatter now keeps title/description only when they are
strings, falling back to the filename-derived title otherwise. This
unblocks publishing svelte@5.56.0 (and similarly-formatted docs).

https://claude.ai/code/session_01Dk6cdQKeX3Lr1eDoL1uTXM
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 30, 2026

🦋 Changeset detected

Latest commit: cdd9a7d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@neuledge/context Patch
@neuledge/registry Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@moshest moshest merged commit 8248ded into main May 30, 2026
3 checks passed
@moshest moshest deleted the claude/svelte-publish-error-cRsIf branch May 30, 2026 19:56
@github-actions github-actions Bot mentioned this pull request May 30, 2026
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