Next.js Discord

Discord Forum

Next config not propegating into Images of the project

Answered
New Guinea Freshwater Crocodile posted this in #help-forum
Open in Discord
Avatar
New Guinea Freshwater CrocodileOP
my next.config.js
await import("./src/env.js");

/** @type {import("next").NextConfig} */
const config = {
  images: {
    remotePatterns: [
      {
        protocol: "https",
        hostname: "images.unsplash.com",
      },
      {
        protocol: "https",
        hostname: "i.ibb.co",
      },
      {
        protocol: "https",
        hostname: "slimages.macys.com",
        port: "",
        pathname: "**"
      },
      {
        protocol: "https",
        hostname: "a0.muscache.com",
      },
    ],
  },
};

export default config;


and for some reason I'm seeing this
what is happening?
Image
Answered by B33fb0n3
you need to add the hostname slimages.macyassets.com to your images config. Right now you havent added this domain yet and because of that nextjs restricts the access
View full answer

4 Replies

Avatar
you need to add the hostname slimages.macyassets.com to your images config. Right now you havent added this domain yet and because of that nextjs restricts the access
Answer
Avatar
New Guinea Freshwater CrocodileOP
oh duh, I guess i needed to look away for a couple of minutes to see that the domain in the config is not the same lol
Avatar
yea, after you added it there nextjs should allow the access
Avatar