Skip to content

[marked-shiki] Parse error: Cannot read properties of undefined (reading 'split') #180

Closed

Description

@XuJinNet
  • Extension Name: marked-shiki
  • Extension Version: 1.2.0
  • Project Version:
  • Device: Desktop
  • OS@version (or Browser): Chrome@138
  • Node And NPM Version: v22.17.1 and v10.9.2

Description

When parsing the following JSON string using marked, an error will occur:

const msg = `
{
    "id": "9raywezf4pnm9n84rgfh4h9afr",
    "user_id": "1azsqgqorbntue9mjq9apzgeqa",
    "applicant": "liwenxuan",
    "creator_id": "1azsqgqorbntue9mjq9apzgeqa",
    "create_at": 1753149457445,
    "update_at": 1753149457445,
    "type": "annual_leave",
    "start_time": "2025-07-22 AM",
    "start_millis": 1753113600000,
    "end_time": "2025-07-22 AM",
    "end_millis": 1753156799999,
    "apply_days": 0.5,
    "semidays": 1,
    "time_zone": "Asia/Shanghai",
    "reason": "123",
    "pictures": [
     
    ],
    "status": "pending",
    "working_days": [
        1,
        2,
        3,
        4,
        5
    ],
    "detail_working_semidays": {
        "2025-07-22 AM": 0
    }
}
`;
marked.parse(msg);

Error:

TypeError: Cannot read properties of undefined (reading 'split')
Please report this to https://github.com/markedjs/marked.
Image

To Reproduce (⚠️ read below)

https://github.com/XuJinNet/marked-test

Expected Behavior

Actual Behavior

Additional Information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions