Hello Sitecore Community,
I would like to share a problem with Next JS app,
We are using Azure Linux Web App with Node JS 20 and Next JS version 14.2.25.
If anyone has faced similar issue or some suggestion.
⨯ Failed to write image to cache 5cv6qnjptWX6SB1NYl+U8ruPAJYmCLm3JI6f33bnmmE= Error: ENOENT: no such file or directory, mkdir '/home/site/wwwroot/.next/cache' at async Object.mkdir (node:internal/fs/promises:858:10) at async writeToCacheDir (/home/site/wwwroot/node_modules/next/dist/server/image-optimizer.js:178:5) at async ImageOptimizerCache.set (/home/site/wwwroot/node_modules/next/dist/server/image-optimizer.js:451:13) at async /home/site/wwwroot/node_modules/next/dist/server/response-cache/index.js:121:25 at async /home/site/wwwroot/node_modules/next/dist/lib/batcher.js:45:32 { errno: -2, code: 'ENOENT', syscall: 'mkdir', path: '/home/site/wwwroot/.next/cache' } Another Instance of the error
Failed to update prerender cache for /en/_site_xyz/abc/def Error: ENOENT: no such file or directory, mkdir '/home/site/wwwroot/.next/server/pages/en/_site_xyz/abc' at async Object.mkdir (node:internal/fs/promises:858:10) at async FileSystemCache.set (/home/site/wwwroot/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js:263:13) at async IncrementalCache.set (/home/site/wwwroot/node_modules/next/dist/server/lib/incremental-cache/index.js:400:13) at async /home/site/wwwroot/node_modules/next/dist/server/response-cache/index.js:121:25 at async /home/site/wwwroot/node_modules/next/dist/lib/batcher.js:45:32 { errno: -2, code: 'ENOENT', syscall: 'mkdir', path: '/home/site/wwwroot/.next/server/pages/en/_site_xyz/abc' }
ls -la /home/site/wwwroot/.nextdir exist? If not, your deploy is not copying build artifacts ornpm run buildisn’t running on deploy.