question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

next/image with priority -> preload without crossorigin="anonymous"

See original GitHub issue

What version of Next.js are you using?

10.2.0

What version of Node.js are you using?

14.16.0

What browser are you using?

Chrome

What operating system are you using?

Windows

How are you deploying your application?

Other platform

Describe the Bug

Setting priority on the next/image component, the image will be preloaded without crossorigin=“anonymous” and not correctly preloaded:

<link rel="preload" as="image" href="https://external/image.jpg">

This is the warning reported: The resource https://external/image.jpg was preloaded using link preload but not used within a few seconds from the window’s load event. Please make sure it has an appropriate as value and it is preloaded intentionally.

Expected Behavior

<link rel="preload" as="image" href="image.jpg" crossorigin="anonymous">

To Reproduce

<Image
      loader={myLoader}
      src="/me.png"
      alt="Picture of the author"
      width={500}
      height={500}
      priority
    />

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
PudparKcommented, Jul 29, 2021

My image is also rendering pixelated. Then seconds later I get the error below. I do notice that it fixes the image if I extend the viewport back and forth.

The resource http://localhost:3000/_next/image?url=imageUrlHere was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.
0reactions
georgekraxcommented, Sep 1, 2022

@PudparK Same issue!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Image component with priority doesn't preload #20438 - GitHub
Bug report Describe the bug The priority prop for components doesn't preload images. To Reproduce Add an component with a priority prop, ...
Read more >
next/image - Next.js
When true, the image will be considered high priority and preload. Lazy loading is automatically disabled for images using priority .
Read more >
Nextjs image optimization with examples - Refine Dev
Built-in image optimization using next image component. ... prop tells the browser to preload the image as it's considered a high priority.
Read more >
Nextjs Image: was preloaded using link preload but not used ...
I get this error in the console: The resource http://localhost:3001/_next/image?url=%2Fimg%2Flogo.png&w=640&q=75 was preloaded using link ...
Read more >
Next.js automatic image optimization with next/image
priority prop. By default, images are not prioritized (because they are lazy-loaded), meaning priority defaults to false ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found