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/og does not generate correctly text with text-wrap: balance css property when there is only one word #62887

Closed
grzegorzpokorski opened this issue Mar 5, 2024 · 3 comments
Labels
bug Issue was opened via the bug report template. locked Runtime Related to Node.js or Edge Runtime with Next.js.

Comments

@grzegorzpokorski
Copy link

grzegorzpokorski commented Mar 5, 2024

Link to the code that reproduces this issue

https://github.com/grzegorzpokorski/nextjs-og-issue

To Reproduce

  1. Clone reproduction repo: git clone https://github.com/grzegorzpokorski/nextjs-og-issue.git
  2. Run project pnpm build && pnpm start.
  3. Go to http://localhost:3000/api/og?title=Loremipsumdolor
  4. You should see a simple image with text which is not centered.

Current vs. Expected behavior

Expected behawiour is to generate a image with centered text, as it is for example when you visit this path: http://localhost:3000/api/og?title=Lorem%20ipsum%20dolor%20sit%20amet,%20consectetur

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP Thu Oct 5 21:02:42 UTC 2023
Binaries:
  Node: 18.18.2
  npm: 9.8.1
  Yarn: N/A
  pnpm: 8.15.4
Relevant Packages:
  next: 14.1.2
  eslint-config-next: 14.1.2
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.3.3
Next.js Config:
  output: N/A

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

App Router, Middleware / Edge (API routes, runtime)

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

next start (local), Vercel (Deployed)

Additional context

No response

@grzegorzpokorski grzegorzpokorski added the bug Issue was opened via the bug report template. label Mar 5, 2024
@github-actions github-actions bot added the Runtime Related to Node.js or Edge Runtime with Next.js. label Mar 5, 2024
@philwolstenholme
Copy link
Contributor

ImageResponse uses a package called Satori which implements its own version of text-wrap here: https://github.com/vercel/satori/blob/9bc47fd41937be1bc96db2c91420323d034bebef/src/text/index.ts#L375-L390

Is it maybe this bug that you're experiencing? vercel/satori#498

You could post in the Satori repo instead of the Next repo, it might get more attention :)

@grzegorzpokorski
Copy link
Author

@philwolstenholme thanks, you have right

Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. locked Runtime Related to Node.js or Edge Runtime with Next.js.
Projects
None yet
Development

No branches or pull requests

2 participants