I'm new to web development. This might be a stupid question, but I can't figure it out after consulting countless pages, so I'm plucking up the courage to ask.
I've built the source code with Next.js v13.3
, but the image paths are getting weird. In dev mode, the image is clearly showing up fine, but it's not working in production.
Here is my next.config.js
file:
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
experimental: {
appDir: true,
},
distDir: "out",
output: "export",
};
module.exports = nextConfig;
And I also tried this.
images: {
loader: "imgix",
path: "",
},
My images are all inside the public folder, and routing works fine. After building, the image partial source looks like this:
If you run npm run start with output: "export" removed, it should work fine. However, I need to deploy it to Cloudflare pages, so I need to make it a static HTML file. Is there anything else I can try here?
Please help me to solve this problem. Thank you for reading!
I've tried changing the baseurl and output variables in the next.config.js
file, and I've searched everywhere else, but I can't find a solution.