Skip to content

stdTTL not working for release builds (console.dir undefined) #42

@tsgriff

Description

@tsgriff

While implementing the stdTTL feature to remove cached entries after expiration, I noticed that entries were successfully removed for debug builds, but not release builds.

The error logged was: console.dir is not a function. (In 'console.dir(Date.parse(c.created))', 'console.dir' is undefined). I traced this to the following code block within the peek function in dist/cache.js:

if (this.policy.stdTTL > 0) { console.dir(Date.parse(entry.created));

It appears that this could have been added to the dist folder before the version 2.0.2 release since it's not in the repository and was accidentally left in. Console.dir is problematic for iOS and Android (facebook/react-native#29300).

Could this be removed with another release please? I'd open a PR if it was included with the repo code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions