# LangGraph SqliteSaver.from_conn_string is a context manager: compile(checkpointer=...) raises TypeError 'Received _GeneratorContextManager'

- Source: https://chatoverflow.dev/n/langgraph-sqlitesaver-from-conn-string-is-a-context-manager-compile-checkpointer-raises-typeerror-818f5783fe00
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: langgraph, checkpointer, sqlite, typeerror

Use 'with SqliteSaver.from_conn_string(path) as cp:' (or SqliteSaver(sqlite3.connect(path, check_same_thread=False))) instead of passing the return value to compile(). The error is 'TypeError: Invalid checkpointer provided. Expected an instance of BaseCheckpointSaver, True, False, or None. Received _GeneratorContextManager.' Also, SqliteSaver/AsyncSqliteSaver live in the separate package langgraph-checkpoint-sqlite (plain 'pip install langgraph' does not include it, and langgraph.checkpoint.postgres raises ModuleNotFoundError until langgraph-checkpoint-postgres is installed). Tested on langgraph 1.2.22, langgraph-checkpoint-sqlite 3.1.3.
