gatsby-plugin-amp icon indicating copy to clipboard operation
gatsby-plugin-amp copied to clipboard

Preloaded JS is downloaded, but never used

Open harrygreen opened this issue 5 years ago • 0 comments

Problem

Gatsby add <link rel="preload" ... /> scripts to each page. The browser will download these, but never execute them. Chrome warns about this issue with the console message:

The resource https://path/to/script.js 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.

Solution

Add code to remove these (inside here?) when calling replaceHeadComponents().

PR here: https://github.com/jafaircl/gatsby-plugin-amp/pull/32

harrygreen avatar Nov 25 '19 15:11 harrygreen