There was an error while loading. Please reload this page.
2 parents 74a0fb8 + 7fc2a00 commit 3c23a94Copy full SHA for 3c23a94
lib/cache.ts
@@ -31,5 +31,9 @@ export function setCache(key: string | null, object: unknown): void {
31
if (!makeDirectory(cacheRoot)) return
32
33
const filePath = path.join(cacheRoot, `${key}.txt`)
34
- fs.writeFileSync(filePath, JSON.stringify(object as JSON))
+ try {
35
+ fs.writeFileSync(filePath, JSON.stringify(object as JSON))
36
+ } catch (error) {
37
+ console.warn('Could not write to file cache. This is expected during ISR, but not during deploy.', error)
38
+ }
39
}
0 commit comments