fix(infra): disable Next image disk cache for read-only Nix store

Next.js image optimizer mkdirs <distDir>/cache/images on first
optimized-image request. In the Nix store that path is read-only, so
every image request throws EACCES unhandledRejection. images.maximumDiskCacheSize=0
plus experimental.isrFlushToDisk=false keep the optimizer in-memory only.
This commit is contained in:
asepharyana
2026-08-03 04:05:03 +07:00
parent f35edb00d7
commit 6829c7efe2
+10
View File
@@ -5,6 +5,16 @@ const nextConfig: NextConfig = {
turbopack: { turbopack: {
root: process.cwd(), root: process.cwd(),
}, },
// Nix store is read-only at runtime; Next.js tries to mkdir
// <distDir>/cache/images for the on-disk image optimizer LRU and
// crashes with EACCES unhandledRejection on every optimized image
// request. Disable the disk cache (and disable ISR flush which gates it).
images: {
maximumDiskCacheSize: 0,
},
experimental: {
isrFlushToDisk: false,
},
}; };
export default nextConfig; export default nextConfig;