Next.js Discord

Discord Forum

next/image hostname is not configured under images in your next.config.js

Answered
Ocicat posted this in #help-forum
Open in Discord
OcicatOP
I have the following config
/** @type {import('next').NextConfig} */
const nextConfig = {
        images: {
          remotePatterns: [
            {
              protocol: 'https',
              hostname: '**',
              port: '',
              pathname: '/*',
            },
          ],
        },
};

export default nextConfig;

One source works but the other does not.
Answered by Arinji
@Ocicat @Northern Rough-winged Swallow

    remotePatterns: [
      {
        protocol: "https",
        hostname: "**",
      },
    ],
View full answer

11 Replies

Maybe the source doesnt use https?
OcicatOP
They are both s3 buckets.
Same permissions.
Maybe pathname is the issue :/ ommit port and pathname
Northern Rough-winged Swallow
did it work ?
i have the same issue
how did you fix it ?
@Ocicat @Northern Rough-winged Swallow

    remotePatterns: [
      {
        protocol: "https",
        hostname: "**",
      },
    ],
Answer
Try that
@Arinji <@170783910337314818> <@589888676817797126> remotePatterns: [ { protocol: "https", hostname: "**", }, ],
OcicatOP
I ended up doing something similar
I'll mark it as a solution however since its posted here.
Thank you.
Northern Rough-winged Swallow
this doesnt work incase the pathname has multiple .
but i made it work so nvm