langchain-ai/langgraph · error · InvalidModuleError
Refused to deserialize JSON constructor: {dotted}. No allowe
Error message
Refused to deserialize JSON constructor: {dotted}. No allowed_json_modules configured.
Unblock with ONE of:
• JsonPlusSerializer(allowed_json_modules=[{needed!r}, ...])
• (DANGEROUS) JsonPlusSerializer(allowed_json_modules=True)
Note: Prefix allowlists are intentionally unsupported; prefer exact symbols or plain-JSON representations revived without import-time side effects. What it means
Error "Refused to deserialize JSON constructor: {dotted}. No allowed_json_modules configured. Unblock with ONE of: • JsonPlusSerializer(allowed_json_modules=[{needed!r}, ...]) • (DANGEROUS) JsonPlusSerializer(allowed_json_modules=True) Note: Prefix allowlists are intentionally unsupported; prefer exact symbols or plain-JSON representations revived without import-time side effects." thrown in langchain-ai/langgraph.
Source
Thrown at libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py:234
"(legacy_method_field=%s, error=%s); returning None",
".".join((*module, name)),
"method" in value,
type(exc).__name__,
)
return None
def _check_allowed_json_modules(self, value: dict[str, Any]) -> None:
needed = tuple(value["id"])
dotted = ".".join(needed)
# Safe types (the same set already allowed for msgpack deserialization) are
# permitted without an explicit allowlist — they are known-safe LangGraph and
# LangChain types. This restores backwards-compat for old "json" checkpoints
# that pre-date the msgpack migration without reopening the broader security gate.
if _is_safe_json_type(list(needed)):
return
if not self._allowed_json_modules:
raise InvalidModuleError(
f"Refused to deserialize JSON constructor: {dotted}. "
"No allowed_json_modules configured.\n\n"
"Unblock with ONE of:\n"
f" • JsonPlusSerializer(allowed_json_modules=[{needed!r}, ...])\n"
" • (DANGEROUS) JsonPlusSerializer(allowed_json_modules=True)\n\n"
"Note: Prefix allowlists are intentionally unsupported; prefer exact symbols "
"or plain-JSON representations revived without import-time side effects."
)
if self._allowed_json_modules is True:
return
if needed in self._allowed_json_modules:
return
raise InvalidModuleError(
f"Refused to deserialize JSON constructor: {dotted}. "
"Symbol is not in the deserialization allowlist.\n\n"
"Add exactly this symbol to unblock:\n"View on GitHub (pinned to 38031739e5)
When it happens
Trigger: Thrown at libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py:234 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of langchain-ai/langgraph@38031739e5 (2026-08-26).
Data as JSON: /api/errors/db9d131010b8c252.
Report an issue: GitHub.