Skip to content

Fix placeholder images after disabling Next.js SVG image support #472

Description

@coderabbitai

Summary

The Next.js image configuration removes dangerouslyAllowSVG: true. The getSafePlaceholderImageUrl helper still produces https://placehold.co/... placeholder URLs. This can prevent placeholder and fallback images from rendering in production when the remote response is SVG.

Required changes

  • Review getSafePlaceholderImageUrl and all placeholder image call sites.
  • Make the placeholder format compatible with the current next/image SVG policy, or explicitly configure the required safe SVG handling.
  • Keep the remote image allowlist aligned with the selected placeholder solution.

Rationale

Placeholder and fallback images must render when a primary image is unavailable. The current configuration change can break this behavior for placehold.co SVG responses.

Affected areas

  • next.config.ts
  • The module that defines getSafePlaceholderImageUrl
  • Components that use placeholder or fallback image URLs

Acceptance criteria

  • Placeholder and fallback images render in production.
  • The selected solution does not re-enable unsafe SVG processing without the required safeguards.
  • The configured remotePatterns allow the selected placeholder host and path.
  • Add or update focused coverage where practical.

Backlinks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions