Skip to content
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

next/image fails with an Arabic phrase #74897

Open
jefer94 opened this issue Jan 15, 2025 · 1 comment
Open

next/image fails with an Arabic phrase #74897

jefer94 opened this issue Jan 15, 2025 · 1 comment
Labels
bug Issue was opened via the bug report template. Image (next/image) Related to Next.js Image Optimization.

Comments

@jefer94
Copy link

jefer94 commented Jan 15, 2025

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/intelligent-waterfall-5htj5v?workspaceId=ws_2L9qrGbsdQSgPmvDvdbcYv

To Reproduce

  1. go to /og

Current vs. Expected behavior

  1. Can render the image
  2. This package hasn't any error message, the development experience is bad, next/image must report the issues it found, besides the documentation must be improved, if an image randomly fails how could we render a fallback image for example? this and all related with this module must be documented and covered

Provide environment information

> @ info /project/workspace
> next info


Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
  Available memory (MB): 4102
  Available CPU cores: 2
Binaries:
  Node: 20.9.0
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 8.10.2
Relevant Packages:
  next: 15.2.0-canary.10 // Latest available version is detected (15.2.0-canary.10).
  eslint-config-next: N/A
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.3.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Image (next/image)

Which stage(s) are affected? (Select all that apply)

next dev (local), next start (local)

Additional context

import { ImageResponse } from "next/og";
// import { ImageResponse } from "@vercel/og";
import { NextRequest } from "next/server";

export async function GET(request: NextRequest) {
  return new ImageResponse(
    (
      <div
        // lang='en'
        lang="ar"
        style={{
          fontSize: 128,
          background: "white",
          width: "100%",
          height: "100%",
          display: "flex",
          textAlign: "center",
          alignItems: "center",
          justifyContent: "center",
        }}
      >
        {/* Hello */}
        نطق الأسماء على المستوى
      </div>
    ),
    {
      width: 1200,
      height: 600,
    }
  );
}
@jefer94 jefer94 added the bug Issue was opened via the bug report template. label Jan 15, 2025
@github-actions github-actions bot added the Image (next/image) Related to Next.js Image Optimization. label Jan 15, 2025
@andersonleite
Copy link
Contributor

andersonleite commented Jan 15, 2025

Just some investigation about this:

The image generation uses vercel/satori.

And in the readme, it says:
RTL languages are not supported.

Looks like some support for Arabic is on the way since there is a test for it
https://github.com/vercel/satori/blob/main/test/language.test.tsx#L81

I also can run the example text on local playground (not on the live one)
Image

But for a longer text as the one provided in the codebox, it throws an error…
نطق الأسماء على المستوى
lookupType: 5 - substFormat: 3 is not yet supported

Also, just another note. Next.js currently uses satori": "0.10.9and the latest satori release is 0.12.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Image (next/image) Related to Next.js Image Optimization.
Projects
None yet
Development

No branches or pull requests

2 participants