next/image with priority -> preload without crossorigin="anonymous"
See original GitHub issueWhat 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:
- Created 2 years ago
- Comments:5
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
@PudparK Same issue!