chriskyfung / amp-affiliately-jekyll-theme

An AMP-Ready Jekyll Blog Theme
https://chriskyfung.github.io/amp-affiliately-jekyll-theme/
MIT License
18 stars 11 forks source link

🐛 Fix Preload Resource Error in DevTools Console #60

Closed chriskyfung closed 5 months ago

chriskyfung commented 5 months ago

Description:

We are encountering an error in the DevTools console related to resource preloading. The specific error message is:

A preload for 'https://chriskyfung.github.io/amp-affiliately-jekyll-theme/assets/images/logo-plainSVG.svg' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.

This error indicates a mismatch between the request credentials mode and the 'crossorigin' attribute in the <link rel="preload"> tag.

Steps to Reproduce:

  1. Open the website in Microsoft Edge.
  2. Open the DevTools console.
  3. Notice the error message.

Expected Behavior:

The resources should be preloaded correctly without any errors in the console.

Actual Behavior:

The browser found a preload link for 'logo-plainSVG.svg' but didn't use it due to a credentials mode mismatch.

Proposed Solution:

We need to adjust the 'crossorigin' attribute in the <link rel="preload"> tag to match the credentials mode. This could be 'anonymous' or 'use-credentials', depending on the requirements of the resource being preloaded.

Additional Information:

Please ensure to test the changes in Microsoft Edge as the error was identified in this browser.