I have an image issue in my nextjs application that it was working yesterday. The error is simple and clear:
Error: Invalid src prop (https://picsum.photos/200) on `next/image`, hostname "picsum.photos" is not configured under images in your `next.config.js`
See more info: https://nextjs.org/docs/messages/next-image-unconfigured-host
I configured the url in next.config.js file and it was working. Today, I opened the project and get the error. The interesting part is this is working in another computer. Also, I reinstalled .next
and node_modules
but this did not resolve the issue either.
next.config.js
file:
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
basePath: "",
images: {
remotePatterns: [
{
protocol: "https",
hostname: "gittjeqpqcmmbterylkd.supabase.co",
port: "",
pathname: "/**",
},
{
protocol: "https",
hostname: "picsum.photos",
port: "",
pathname: "/**",
},
],
},
webpack: (config) => {
config.resolve.alias.canvas = false;
return config;
},
};