nuxt / nuxt/image

Another local image issue in SSR mode!

Open
#1,822 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.5k
Forks
331
Avg merge
19h 52m
Merged PRs (30d)
9

Description

Hello Nuxt Image Team,

I hope this message finds you well. I wanted to bring to your attention an ongoing issue I've encountered while using the img function with multilingual images.

I previously implemented the following code to define thumbnails for different languages:

// Define thumbnails for each language
const thumbnailEn = img('/thumbnail.webp', {
  format: 'webp',
  width: 1200,
  height: 630,
  placeholder: [50, 50, 75, 75]
})

const thumbnailEs = img('/thumbnail-es.png', {
  format: 'webp',
  width: 1200,
  height: 630,
  placeholder: [50, 50, 75, 75]
})

const thumbnailAr = img('/thumbnail-ar.png', {
  format: 'webp',
  width: 1200,
  height: 630,
  placeholder: [50, 50, 75, 75]
})

// Create a computed property to determine which thumbnail to use
const optimizedThumbnail = computed(() => {
  switch (locale.value) {
    case 'es':
      return thumbnailEs
    case 'ar':
      return thumbnailAr
    default:
      return thumbnailEn
  }
})

useSeoMeta({
  ogImage: optimizedThumbnail,
})

However, I've been experiencing issues with all locally added images. This is the third time I've reported this problem in the past two weeks, and unfortunately, it remains unresolved.

We rely on this tool for our multilingual SEO needs, so I would greatly appreciate your assistance in fixing this error.

you can check the prior ones here #1806

Thank you for your attention to this matter. I look forward to your prompt response.

Best regards,
Bader Idris

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing this report with prior issue #1806 and reproducing the shown img and useSeoMeta usage in Nuxt SSR with local multilingual images. Done means the localized ogImage works for the listed locales without errors, with regression coverage added if the project’s existing tests support this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxtjs, typescript
Domain
performance, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.