我正在尝试使用react-redux,但是每当我从redux或react-redux导入任何内容时,都会一直出现此错误:
async function getCacheInfo() {
const cacheMap = new Map();
const cacheNames = await window.caches.keys();
for (const cacheName of cacheNames) {
const cache = await window.caches.open(cacheName);
cacheMap.set(cacheName, 0);
const requests = await cache.keys();
requests.forEach((request) => {
cacheMap.set(cacheName, cacheMap.get(cacheName) + 1);
});
}
return cacheMap;
}
async function printTable() {
const cacheInfo = await getCacheInfo();
console.log(cacheInfo);
console.log(cacheInfo.get('html-cache')); // Returns undefined
}
(async () => {
await printTable();
})();
我的项目目录为'ill'。
关于如何解决的任何想法?
答案 0 :(得分:0)
您需要安装redux才能加载react-redux
npm install --save redux react-redux