Warning: <link rel=preload> must have a valid `as` value Warning: <link rel=preload> must have a valid `as` value google-chrome google-chrome

Warning: <link rel=preload> must have a valid `as` value


Maybe this warning is a bug

[as]- this attribute is used when rel="preload" or rel="prefetch" has been set on the element.It specifies the type of content being loaded/prefetchedInstead, 'preload' you can also use 'prefetch'

<link rel="prefetch" href="./img/intro.mp4" as="video">

So You can accomplish your task


Hopefully this answer will get outdated soon, but when I look at the official docs, (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link), I find that "preload" has questionable support for both Chrome and Safari. The warning we are all seeing is likely due to the fact that Chrome/Safari is recognizing the "preload" tag but is not recognizing "audio" (or whatever you are using) as a valid value for the "as" tag.

Regarding the answer saying to replace "preload" with "prefetch", do not do this. In fact, as a general rule, I would never in any situation assume that two differntly-named tags/variables/anythings are the same. "Prefetch" will load a resource in preparation for a navigation, while "preload" will load a resource on the currently navigated page before anything is rendered. More info one preload here: https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types/preload