{"record":{"id":"0921fca62d0af0f1","repo":"redis/node-redis","slug":"client-side-caching-is-only-supported-with-resp3-0921fc","errorCode":null,"errorMessage":"Client Side Caching is only supported with RESP3","messagePattern":"Client Side Caching is only supported with RESP3","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/client/lib/cluster/cluster-slots.ts","lineNumber":272,"sourceCode":"  readonly scanCursors = new Map<string, ScanCursorEntry>();\n  #cursorTokenSeq = 0;\n  #topologyRefreshPromise?: Promise<boolean | void>;\n\n  #isOpen = false;\n\n  get isOpen() {\n    return this.#isOpen;\n  }\n\n  #isReady = false;\n\n  get isReady() {\n    return this.#isReady;\n  }\n\n  #validateOptions(options?: RedisClusterOptions<M, F, S, RESP, TYPE_MAPPING>) {\n    if (options?.clientSideCache && (options?.RESP ?? DEFAULT_RESP) !== 3) {\n      throw new Error('Client Side Caching is only supported with RESP3');\n    }\n  }\n\n  constructor(\n    options: RedisClusterOptions<M, F, S, RESP, TYPE_MAPPING>,\n    emit: EventEmitter['emit'],\n    clusterClientId: string\n  ) {\n    this.#validateOptions(options);\n    this.#options = options;\n    this.#himportRegistry = options.himportRegistry ?? new FieldsetRegistry();\n    this.#clusterClientId = clusterClientId;\n    this.#reconnectionTracker = new ClusterReconnectionTracker(options.topologyRefreshOnReconnectionAttemptStrategy);\n\n    if (options?.clientSideCache) {\n      if (options.clientSideCache instanceof PooledClientSideCacheProvider) {\n        this.clientSideCache = options.clientSideCache;\n      } else {","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/redis/node-redis/blob/90fd0652bc3f2a0a1b2f79fa9096b02a86b0ac58/packages/client/lib/cluster/cluster-slots.ts#L254-L290","documentation":"Thrown by RedisClusterSlots.#validateOptions during cluster construction when clientSideCache is configured but the negotiated RESP version is not 3. Redis Client Side Caching (CSC / tracking) requires the RESP3 protocol, which must be explicitly requested via the RESP: 3 option.","triggerScenarios":"Passing createCluster({ ..., clientSideCache: {...}, RESP: 2 }) or omitting RESP (which defaults to a non-3 value) while also passing a clientSideCache provider. The validation runs in the constructor before any connection is made.","commonSituations":"Enabling client-side caching without knowing it is RESP3-only; copy-pasting a CSC config into an existing cluster that pins RESP: 2 for compatibility; default RESP not being 3 in the current library version.","solutions":["Set RESP: 3 on the cluster options (and on every node configuration) when using clientSideCache.","Verify the Redis server version is >= 6.0 with RESP3 support enabled.","If you cannot move to RESP3, remove the clientSideCache option.","Ensure RESP is not overridden to 2 at the per-node RedisClusterClientOptions level."],"exampleFix":"// before\ncreateCluster({ rootNodes, clientSideCache: { ... } }); // RESP defaults, not 3 -> throws\n\n// after\ncreateCluster({ rootNodes, RESP: 3, clientSideCache: { ... } });","handlingStrategy":"validation","validationCode":"const resp = options.RESP ?? 2;\nif (options.clientSideCache && resp !== 3) {\n  throw new Error('Enable RESP: 3 to use clientSideCache, or remove clientSideCache.');\n}","typeGuard":"function cscConfigValid(opts: { clientSideCache?: unknown; RESP?: number }): boolean {\n  return !opts.clientSideCache || (opts.RESP ?? 2) === 3;\n}","tryCatchPattern":null,"preventionTips":["Always set RESP: 3 when configuring clientSideCache.","Ensure RESP is not overridden to 2 at the per-node options level.","Confirm the Redis server supports RESP3 (>= 6.0)."],"tags":["cluster","client-side-caching","resp3","configuration"],"backgroundTag":null,"analyzedSha":"90fd0652bc3f2a0a1b2f79fa9096b02a86b0ac58","analyzedAt":"2026-08-11T15:37:21.243Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}