Hi
I’m working on building my Next.js 14 app, but I’m having trouble with the public
folder, which contains images. After building the app, I can’t find the public
folder in the .next
build directory. As a result, the images are not being found, and I’m getting 404 errors.
I’ve been trying to resolve this issue for a couple of days but haven’t found a solution yet. Can someone help me understand how to properly include and deploy the public
folder so that the images are available on the server?
//next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
i18n: {
defaultLocale: 'en',
locales: ['en', 'hi'],
},
// images: {
// domains: ['co-buy.uk'],
// },
assetPrefix: 'https://co-buy.uk',
};
export default nextConfig;
//netlify.toml
[[plugins]]
package = "@netlify/plugin-nextjs"
[build]
command = "npm run build"
publish = "out"
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
[functions]
[functions.___netlify-server-handler]
included_files = ["./public/**"]