langchain-ai/langgraph · error · InvalidModuleError

Refused to deserialize JSON constructor: {dotted}. Symbol is

Error message

Refused to deserialize JSON constructor: {dotted}. Symbol is not in the deserialization allowlist.

Add exactly this symbol to unblock:
  JsonPlusSerializer(allowed_json_modules=[{needed!r}, ...])
Or, as a last resort (DANGEROUS):
  JsonPlusSerializer(allowed_json_modules=True)

What it means

Error "Refused to deserialize JSON constructor: {dotted}. Symbol is not in the deserialization allowlist. Add exactly this symbol to unblock: JsonPlusSerializer(allowed_json_modules=[{needed!r}, ...]) Or, as a last resort (DANGEROUS): JsonPlusSerializer(allowed_json_modules=True)" thrown in langchain-ai/langgraph.

Source

Thrown at libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py:249

            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"
            f"  JsonPlusSerializer(allowed_json_modules=[{needed!r}, ...])\n"
            "Or, as a last resort (DANGEROUS):\n"
            "  JsonPlusSerializer(allowed_json_modules=True)"
        )

    def dumps_typed(self, obj: Any) -> tuple[str, bytes]:
        if obj is None:
            return "null", EMPTY_BYTES
        elif isinstance(obj, bytes):
            return "bytes", obj
        elif isinstance(obj, bytearray):
            return "bytearray", obj
        else:
            try:
                return "msgpack", _msgpack_enc(obj)

View on GitHub (pinned to 38031739e5)

When it happens

Trigger: Thrown at libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py:249 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/ad82d9eebd8f22b8. Report an issue: GitHub.