microlinkhq/keyvhq

Problem using '@keyv/compress-gzip' with redis

cmartin81 opened this issue · 1 comments

Just tried adding '@keyv/compress-gzip' to my keyv instance.

import Keyv from 'keyv';
const KeyvGzip = require('@keyv/compress-gzip');
const klineCache = new Keyv('redis://localhost:6379', { compression: new KeyvGzip()});

When trying to fetch an object I know that is not in cache I get this error:

return JSON.parse(s, function (key, value) {
              ^
SyntaxError: "undefined" is not valid JSON

Should compress-gzip handle undefined objects?