Symptom
parse_json_markdown raises JSONDecodeError: Expecting value: line 1 column 1 (char 0) when the fence tag is JSON. The same text through JsonOutputParser raises OutputParserException: Invalid json output. A lowercase json tag parses.
Evidence what you'll see
- The pattern is
_json_markdown_re, compiled withre.DOTALLand a case-sensitive(json)?group. An uppercase tag stays inside the captured payload. - The report's lowercase call returns the object. The uppercase call raises. An untagged fence also parses.
Why it happens
The fence tag is matched case-sensitively, so JSON or Json is left in the text that the JSON decoder reads.
Affected versions
langchain-core 1.6.2 on repository master, Python 3.11.16, Linux.
Fix steps
0 of 2 done
Your check marks stay in this browser only.
How to check it worked
- A fence tagged
jsonreturns the object. A fence taggedJSONno longer raisesJSONDecodeErroronce the tag is lowercase or removed.
If it still fails
- The linked issue does not include a merged change. Pull request 40292 was closed on 8 Sep 2026 and was not merged. The bot close is
not_planned.
Sources and credit
Summarized in our own words from these public reports. Credit goes to their authors.
Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change
Hit an error we don't cover? Submit it