Describe the bug
When running npm run build there are error messages "No such or directory, unlink." The build still completes but indicates on completion that: Cache assets: 0, NonCache assets: 2471, Error assets: 89
To Reproduce
Steps to reproduce the behavior:
npm run build
Error logs display the following messages:
[Error: ENOENT: no such file or directory, unlink '/opt/render/project/src/out/_next/static/chunks/images/images/team/rob_2048.webp'] {
errno: -2,
code: 'ENOENT',
syscall: 'unlink',
path: '/opt/render/project/src/out/_next/static/chunks/images/images/team/rob_2048.webp'
}
Expected behavior
I would just like to understand how to approach resolving this error. The error message is not entirely clear to me. This directory does exist within the codebase. And there are also image files within that directory.
Screenshots
Desktop (please complete the following information):
OS: MacOS Sonoma 14.5
Browser: Arc
Version: Version 1.49.0 (51346)
Chromium Engine Version 126.0.6478.127
Additional context
My next.config.mjs is set up as follows:
All of the images within the codebase are stored in /public/images
/* eslint-disable @typescript-eslint/no-unsafe-call */
import createMDX from "@next/mdx";
import withExportImages from "next-export-optimize-images";
import remarkGfm from "remark-gfm";
/** @type {import('next').NextConfig} */
const nextConfig = await withExportImages({
// Configure `pageExtensions` to include MDX files
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
// Optionally, add any other Next.js config below
output: "export",
});
const withMDX = createMDX({
// Add markdown plugins here, as desired
options: {
remarkPlugins: [remarkGfm],
rehypePlugins: [],
},
});
export default withMDX(nextConfig);
Describe the bug When running npm run build there are error messages "No such or directory, unlink." The build still completes but indicates on completion that:
Cache assets: 0, NonCache assets: 2471, Error assets: 89
To Reproduce Steps to reproduce the behavior:
Expected behavior I would just like to understand how to approach resolving this error. The error message is not entirely clear to me. This directory does exist within the codebase. And there are also image files within that directory.
Screenshots
Desktop (please complete the following information):
Additional context My next.config.mjs is set up as follows:
All of the images within the codebase are stored in
/public/images
Many thanks in advance for any advice!