link rel="preload" for svg image

Cat6
Tourist
10 0 4

Hi! I'm trying to preload an svg image using preload link, but in the network tab of the browser I see that the image gets downloaded twice, and I get a message in the console saying

A preload for 'https://cdn.shopify.com/s/files/.../assets/sprite.svg?v=7974101486466535677' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.

My code is:

  <link rel="preload" as="image" href="{{ 'sprite.svg' | asset_url }}" type="image/svg+xml" crossorigin>

 

Screenshot 2021-11-07 at 19.04.32.png

What am I missing?

Replies 0 (0)