nuxt / nuxt/image

Nuxt-image not working with dynamic src

Open
#630 6 comments 7 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

Nuxt-image does not work with dynamic src in target: static mode and if you specify genegate: {dir: nameDir} in nuxt.config.js. If we specify all this, then the path to the image is set incorrectly. What can be done in such a case? If I use the same thing in a regular tag, then everything works as it should

Put together a project that reflects the problem

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 with the linked reproduction project and its nuxt.config.js, focusing on target: static and the generate directory setting. Compare the image path produced by Nuxt-image for the dynamic src with the working regular img example. Done means dynamic images resolve to the correct generated path in static mode.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.