Skip to content

getFromCache method throws error #11635

Closed

Description

@simon1389

Issue description

getFromCache method in RedisQueryResultCache throws error since version-check

Expected Behavior

the new version of typeorm library should work with the new version-check in the getFromCache function.

Actual Behavior

Since the check of the redis-version being in place ( if (this.isRedis5OrHigher()) { ) this method throws an error when used in a nestjs application using typeorm.
Error thrown: TypeError: Cannot read properties of undefined (reading 'then') TypeError: Cannot read properties of undefined (reading 'then')

Seems the client.get function does not return a promise

Steps to reproduce

Use typeorm version 0.3.26 in a nestjs application with nestjs/typeorm
try to load a cached value via dataSource.queryResultCache.getFromCache

--> error is thrown

My Environment

Dependency Version
Operating System
Node.js version 20
Typescript version ^5.2.2
TypeORM version ^0.3.20

Additional Context

No response

Relevant Database Driver(s)

  • aurora-mysql
  • aurora-postgres
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • mysql
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • spanner
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.

Activity

  1. kafka0238 commented on Sep 24, 2025

    @kafka0238

    I also ran into this problem

  2. StPaulis commented on Nov 5, 2025

    @StPaulis

    I have created a repository for reproduction purposes as I also felt on that issue after updating some projects on 0.3.26.

    Hope that helps.

    Currently, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions