Skip to content

Commit 2bebb57

Browse files
0xharkiratclaude
andcommitted
fix: enable unoptimized images for static export on Cloudflare Pages
The /_next/image/ optimization API doesn't exist in static export mode. Set images.unoptimized when EXPORT_MODE=static or UNOPTIMIZED_IMAGES=true so Next.js serves images directly instead of routing through the API. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1d4b26d commit 2bebb57

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

next.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports = {
2121
assetPrefix,
2222
images: {
2323
...(assetPrefix ? { path: `${assetPrefix}/_next/image` } : {}),
24+
unoptimized: isStatic || process.env.UNOPTIMIZED_IMAGES === "true",
2425
remotePatterns: [
2526
{
2627
protocol: "https",

0 commit comments

Comments
 (0)