Next.js Discord

Discord Forum

Some Images Dont load in production

Unanswered
elpupper posted this in #help-forum
Open in Discord
here is my next.config.mjs

const config = {
  reactStrictMode: true,

  /**
   * If you are using `appDir` then you must comment the below `i18n` config out.
   *
   * @see https://github.com/vercel/next.js/issues/41980
   */
  i18n: {
    locales: ["en"],
    defaultLocale: "en",
  },
  images: {
    remotePatterns: [
      {
        protocol: "https",
        hostname: "**",
      },
    ],
  },
};

simply after a i pnpm run build and then start the server with pm2 the website is live some images load realtively quickly while others dont load at all... and they just dont exist for somereason...

settings the images field to unoptimized solves the problem but i want to use optimized images

2 Replies

What is your PM2 start command?
might also need to install sharp if you're self-hosting