Skip to content

next/image is not working for some images in production #82703

@DabirRahmani

Description

@DabirRahmani

Link to the code that reproduces this issue

https://github.com/DabirRahmani/nextjs-image-issue

To Reproduce

npm run build
npm run start
on production
these images are staticky on assets folder on project

Current vs. Expected behavior

hi there,
in production. i have an issue. image is not generated properly. i have 4 images exactly same in format. but 3 of them are not generated. when i click on image's link its as png. not webp. and the png is not showing anything.

image in production:
https://set.ir/_next/image?url=%2F_next%2Fstatic%2Fmedia%2FmiddleSchool2.ea70b175.png&w=256&q=100

if i change the w in this link it show the image and it downloads the image as webp.
https://set.ir/_next/image?url=%2F_next%2Fstatic%2Fmedia%2FmiddleSchool2.ea70b175.png&w=640&q=100

sth wrong with cached image or web generator

Image

Provide environment information

this happends on nodejs on alpine

package json file
{
  "name": "front",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev --turbopack",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "update-status-code-based-on-backend-enum": "cd src/core/services && node convert-backend-enums-to-json.js"
  },
  "dependencies": {
    "@hookform/resolvers": "^5.0.1",
    "axios": "^1.8.4",
    "cookies-next": "^5.1.0",
    "dayjs": "^1.11.13",
    "framer-motion": "^12.6.3",
    "jalaliday": "^2.3.0",
    "lucide-react": "^0.485.0",
    "next": "^15.3.0",
    "nextjs-toploader": "^3.8.16",
    "react": "^19.0.0",
    "react-dom": "^19.0.0",
    "react-hook-form": "^7.55.0",
    "react-hot-toast": "^2.5.2",
    "react-intersection-observer": "^9.16.0",
    "react-leaflet": "^5.0.0",
    "react-markdown": "^10.1.0",
    "react-otp-input": "^3.1.1",
    "react-player": "^2.16.0",
    "swiper": "^11.2.5",
    "swr": "^2.3.3",
    "use-debounce": "^10.0.4",
    "zod": "^3.24.2"
  },
  "devDependencies": {
    "@eslint/eslintrc": "^3",
    "@tailwindcss/postcss": "^4",
    "@types/node": "^20",
    "@types/react": "^19",
    "@types/react-dom": "^19",
    "eslint": "^9",
    "eslint-config-next": "15.2.2",
    "json-server": "^1.0.0-beta.3",
    "prettier": "^3.6.2",
    "tailwindcss": "^4",
    "typescript": "^5"
  }
}

Which area(s) are affected? (Select all that apply)

Image (next/image)

Which stage(s) are affected? (Select all that apply)

Other (Deployed)

Additional context

No response

NEXT-4689

Metadata

Metadata

Assignees

No one assigned

    Labels

    Image (next/image)Related to Next.js Image Optimization.linear: nextConfirmed issue that is tracked by the Next.js team.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions