Skip to content

RangeError: No value supplied for attribute start when parsing markdown with numbered lists #2241

@sdip15fa

Description

@sdip15fa

Description

When using tryParseMarkdownToBlocks() to parse markdown content containing numbered lists, BlockNote throws a RangeError: No value supplied for attribute start error.

Error Stack Trace

RangeError: No value supplied for attribute start
    computeAttrs index.js:2051
    computeAttrs index.js:2167
    create index.js:2180
    enter index.js:3042
    addElementByRule index.js:2939
    addElement index.js:2884
    addDOM index.js:2792

Minimal Reproduction

import { useCreateBlockNote } from "@blocknote/react";

const editor = useCreateBlockNote();

const markdown = \`
1. First item
2. Second item
3. Third item
\`;

// This throws RangeError
const blocks = await editor.tryParseMarkdownToBlocks(markdown);

Root Cause Analysis

Based on investigation, the issue appears to be a schema mismatch:

  • BlockNote's `numberedListItem` schema requires a `start` attribute
  • The prosemirror-markdown parser provides an `order` attribute instead
  • When ProseMirror tries to create the node, it fails because `start` is required but not supplied

Expected Behavior

Numbered lists should parse correctly without errors.

Actual Behavior

Parser throws `RangeError: No value supplied for attribute start`.

Workaround

Convert numbered lists to bullet lists before parsing:

const preprocessedContent = markdown.replace(/^(\s*)\d+\.\s/gm, "\$1* ");
const blocks = await editor.tryParseMarkdownToBlocks(preprocessedContent);

Environment

  • BlockNote version: 0.41.1, 0.44.0
  • React version: 19
  • Browser: Firefox & Chrome
  • OS: Linux

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions