nextjs-og-image-css-limitations

Replace inline-block with display:flex and alignSelf:flex-start in Next.js OG images.

Updated Jan 23, 2026
One-click install
npx skills add https://github.com/strataga/claude-skill-inception --skill nextjs-og-image-css-limitations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-og-image-css-limitations
Source: https://github.com/strataga/claude-skill-inception/tree/main/nextjs-og-image-css-limitations
Command: npx skills add https://github.com/strataga/claude-skill-inception --skill nextjs-og-image-css-limitations

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Next.js OG image generation with next/og ImageResponse can fail during prerendering when CSS display values are restricted to a subset supported by the rendering engine (Satori).

Core Features & Use Cases

  • Guides replacing unsupported CSS display values with display:flex and alignSelf:flex-start to avoid full-width stretching.
  • Prevents OG image prerender errors during build by aligning with Satori's CSS subset.
  • Applicable to Next.js apps using next/og ImageResponse in server components or API routes for dynamic OG images.

Quick Start

Identify any elements using display: inline-block in OG image components and replace with display: flex and alignSelf: flex-start. Then test by running the Next.js build and visiting the OG image route to confirm there are no errors.

Frequently Asked Questions about nextjs-og-image-css-limitations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Next.js OG image build fail during prerendering?

Your Next.js OG image build fails during prerendering because the Satori rendering engine restricts CSS display values. Replacing unsupported values like inline-block with display:flex resolves this prerendering error.

How do I fix CSS display errors in Next.js ImageResponse?

To fix CSS display errors in Next.js ImageResponse, replace any inline-block display values with display:flex. Add alignSelf:flex-start to prevent the element from stretching to full width.

What CSS properties are supported by Next.js OG image generation?

Next.js OG image generation supports a limited CSS subset via Satori, primarily display:flex. Using unsupported properties like inline-block causes prerender failures, so valid flexbox alternatives are required.

Can I use inline-block CSS in Next.js server component OG images?

No, you cannot use inline-block CSS in Next.js server component OG images because Satori restricts display values. You must use display:flex and alignSelf:flex-start to replicate inline-block behavior without errors.

How do I prevent full-width stretching when fixing Next.js OG image CSS?

To prevent full-width stretching when fixing Next.js OG image CSS, apply alignSelf:flex-start to your elements. This works with the required display:flex replacement to maintain proper element dimensions.

Do I need to test my Next.js OG image route after updating CSS display values?

Yes, you need to test your Next.js OG image route after updating CSS display values. Run the Next.js build and visit the OG image route to verify that the Satori prerendering errors are fully resolved.