Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`<NuxtPicture preload>` ignores `crossorigin` in the preload link

Open Beginner friendly
#2,360 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

  • #2361 by @RaphaelFakhri — closed without merging

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
73/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
nuxt, typescript
Domain
frontend

Research direction

The issue identifies NuxtPicture.vue as the component that needs attention and points to the earlier NuxtImg fix in #1836 for comparison. Read the preload-link generation in NuxtPicture.vue and check how it receives crossorigin from the rendered image or img-attrs. Done means the preload link uses the same crossorigin value as the image; verify with the supplied reproduction.

Written by the indexing model from the issue text.

Description

Environment

@nuxt/image 2.2.0, also on main (5bd8766).

Reproduction
<NuxtPicture
  src="https://images.example.com/hero.jpg"
  width="500"
  height="500"
  crossorigin="anonymous"
  preload
/>

The same happens when crossorigin is set through :img-attrs="{ crossorigin: 'anonymous' }".

Describe the bug

The rendered <img> has crossorigin="anonymous", but the preload link in <head> has no crossorigin attribute:

<link rel="preload" as="image" imagesrcset="... 1x, ... 2x">

Because the credentials mode of the preload does not match the image request, the browser does not reuse the preloaded response. Chrome downloads the image twice and logs:

A preload for '...' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.

<NuxtImg> already adds crossorigin to its preload link (#1835, fixed in #1836). The preload link in NuxtPicture.vue was not updated at the same time.

Expected behavior

The preload link uses the same crossorigin value as the <img> element that <NuxtPicture> renders.

Dominant language
TypeScript
Stars
1.6k
Forks
329
Avg merge
1d 9h
Merged PRs (30d)
13

Getting set up

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.

More from nuxt/image

All issues in nuxt/image

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.