-
Notifications
You must be signed in to change notification settings - Fork 145
Closed
Labels
Description
With the same code that used to work with v4.x.x:
const NodeCache = require('node-cache');
const cacheSsr = new NodeCache({
stdTTL: 5,
checkperiod: 0,
});
module.exports = cacheSsr;
export class SsrCache {
private _cache: any;
constructor() {
this._cache = require('./cacheSsr');
}
get(key) {
const cacheSsr = this._cache;
return cacheSsr.get(key);
}
}
import { SsrCache } from './ssrHelper';
const ssrCache = new SsrCache();
const cachedData = ssrCache.get('key');
it returns the error
TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at NodeCache._getValLength (webpack:///./node_modules/node-cache/lib/node_cache.js?:690:56)
at NodeCache.del (webpack:///./node_modules/node-cache/lib/node_cache.js?:461:38)
at NodeCache._check (webpack:///./node_modules/node-cache/lib/node_cache.js?:600:18)
at NodeCache.get (webpack:///./node_modules/node-cache/lib/node_cache.js?:332:46)
at SsrCache.get
mind that for sure in the cache there's no value for that key
Reactions are currently unavailable