Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preloaded scripts warning #6517

Closed
steida opened this issue Mar 3, 2019 · 10 comments · Fixed by #6532
Closed

Preloaded scripts warning #6517

steida opened this issue Mar 3, 2019 · 10 comments · Fixed by #6532

Comments

@steida
Copy link
Contributor

steida commented Mar 3, 2019

It's the same like #2022

The resource 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.

I am not doing anything weird. Just Link prefetch. It seems it's probably ok, but it can be confusing so maybe docs can be updated.

GoogleChromeLabs/preload-webpack-plugin#8 (comment)

@pantharshit00
Copy link

pantharshit00 commented Mar 3, 2019

I can confirm this.

Chrome Version: 72.0.3626.121

Even zeit.co has these warnings:
image

I think we should use link prefetch for these routing operations as these are not being immediately consumed by the user.

@developit
Copy link
Contributor

Just confirming from the Chrome side here - the way Next is preloading is totally fine. We're hoping to turn off these warnings for resources preloaded with priority=low once that ships.

As a comparison point, if these resources were preloaded via a Service Worker, we wouldn't show any warnings even though the same amount of networking is being done.

timneutkens added a commit to timneutkens/next.js that referenced this issue Mar 5, 2019
timneutkens added a commit that referenced this issue Mar 5, 2019
@joaovieira
Copy link

I just noticed all of our prefetched links are being downloaded with High priority.

While <NextScript>s make sense to be preloaded as they'll all be needed for the current page, any link prefetched with <Link prefetch> is a hint that the page/bundle might be needed in the future. Couldn't we use <link rel="prefetch"> in that case?

As is, prefetched bundles are being downloaded with High priority instead of Low, unnecessarily. Or am I missing something (e.g. Safari support)?

@Odrin
Copy link

Odrin commented Oct 14, 2019

Why is this closed? According to this google article we should use prefetch instead of preload. At least this should be configurable. And Link prop name prefetch is very confusing at this point.

@trainto
Copy link

trainto commented Nov 8, 2019

Firsit time I saw the warning, I thought I've must done something wrong. I tried to figure it out what caused this warning, and I ended up finding that messages also can be seen even nextjs.org site.
I think it should be handled to prevent spending hours for nothing like me.

@okeybond
Copy link

okeybond commented Jun 1, 2020

sorry, this is still an issue,

Screenshot 2020-06-01 at 15 21 04

@timneutkens
Copy link
Member

timneutkens commented Jun 1, 2020

sorry, this is still an issue,

Screenshot 2020-06-01 at 15 21 04

#6517 (comment)

@daveteu

This comment has been minimized.

@innocentdavid

This comment has been minimized.

@miko866

This comment has been minimized.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.