Nextjs hostname is not configured under images in next.config.js

Hey I am getting the following error when trying to display a discord image on my website through their cdn
on `next/image`, hostname "cdn.discordapp.com" is not configured under images in your `next.config.js`
on `next/image`, hostname "cdn.discordapp.com" is not configured under images in your `next.config.js`
I have added the domains into the defineNextConfig inside of next.config.mjs but I still get the same error.
// @ts-check
import { env } from "./src/env/server.mjs";

/**
* Don't be scared of the generics here.
* All they do is to give us autocompletion when using this.
*
* @template {import('next').NextConfig} T
* @param {T} config - A generic parameter that flows through to the return type
* @constraint {{import('next').NextConfig}}
*/
function defineNextConfig(config) {
return config;
}

export default defineNextConfig({
reactStrictMode: true,
swcMinify: true,
// Next.js i18n docs: https://nextjs.org/docs/advanced-features/i18n-routing
i18n: {
locales: ["en"],
defaultLocale: "en",
},
images: {
domains: ["avatars.githubusercontent.com", "cdn.discordapp.com", "lh3.googleusercontent.com"],
},
});
// @ts-check
import { env } from "./src/env/server.mjs";

/**
* Don't be scared of the generics here.
* All they do is to give us autocompletion when using this.
*
* @template {import('next').NextConfig} T
* @param {T} config - A generic parameter that flows through to the return type
* @constraint {{import('next').NextConfig}}
*/
function defineNextConfig(config) {
return config;
}

export default defineNextConfig({
reactStrictMode: true,
swcMinify: true,
// Next.js i18n docs: https://nextjs.org/docs/advanced-features/i18n-routing
i18n: {
locales: ["en"],
defaultLocale: "en",
},
images: {
domains: ["avatars.githubusercontent.com", "cdn.discordapp.com", "lh3.googleusercontent.com"],
},
});
Any clue what's wrong?
5 Replies
barry
barry3y ago
Did you stop the app and start it again
nexxel
nexxel3y ago
restart dev server
rustclan
rustclanOP3y ago
ah.. thanks guys 🙂 was just using the live refresh, didnt restart the whole thing
barry
barry3y ago
👍
julius
julius3y ago
remotePatterns: [{ hostname: “*” }] yolo
Want results from more Discord servers?
Add your server