Skip to content

Chapter 7 - Invalid src prop on next/image #1025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
paulaworkL opened this issue Mar 13, 2025 · 0 comments
Open

Chapter 7 - Invalid src prop on next/image #1025

paulaworkL opened this issue Mar 13, 2025 · 0 comments

Comments

@paulaworkL
Copy link

Hello,

When completing the Fetching data for part of chapter 7 I am getting the following error:

Error: Invalid src prop (https://picsum.photos/id/64/100/100) 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
at Array.map () {
digest: '2506496770'

I've changed my next.config.ts and included the images config like so :

import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  images: {
    remotePatterns: [
      {
        protocol: "https",
        hostname: "picsum.photos",
        port: "",
        pathname: "/id/**",
        search: "",
      },
    ],
  },
};

export default nextConfig;

This worked for me.
If this is correct can you please include it in the repo so that other people do not experience the same issue.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant