-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Lighthouse does not detect my use of modulepreload (recommends using preload) #8945
Comments
Thanks Phil!
On to the issue I only see So Lighthouse appears to be correct in thinking we should load it earlier though why it gets singled out among the other modules isn't super obvious. What Should LH Do Seems like we should probably recommend to As for text, I agree that we should say Side Notes I'm not super familiar with tl;dr - differences in |
Yeah, I just published the new version (using Now it looks like this :)
That's correct. AFAIK
Not 100% sure, but I wouldn't expect to be penalized for not preloading modules I'm dynamically importing. (Also, FWIW, I do precache all those modules in my SW, so when they are dynamically imported they they should already be in the cache -- depending on when the dynamic import actually happens). |
Hm interesting yeah I wonder if there's a way to tell without parsing the source whether a module was asynchronously imported. My guess is not right now because the priority Chrome issues your
Interesting, perhaps my terminology is off then. I was just going off the best practice in that article which was to declare all the deps too. |
Hmmm, actually I think that article is correct and I was wrong. Given that, it's probably still good to recommend using I don't know of a good way via web APIs, but maybe the devtools protocol exposes this information somehow? Related, I wonder if it makes sense for Lighthouse to warn if module scripts are preloaded with regular Again, I can ask around to see what the best practices are here. |
That'd be awesome @philipwalton! We'll hold off making any major changes til we learn more :) |
Interesting discussion here! Any new developments over the last year-and-a-half? I just ran into the same issue where LH (likely falsely) claims I could save 3,000+ ms on a script that's module-preloaded by adding Is this false claim related to the redirect warning in the LH results attached below? LH does not make the same claim when rerunning it on the redirect URL https://sbsev.netlify.app/blog/. |
preload audits have been disabled in anticipation of some large changes on the Chrome side and some pending changes in Lighthouse. See #11960 for details. |
Provide the steps to reproduce
Note: I'm using
<link rel="modulepreload">
instead of<link rel="preload">
.What is the current behavior?
I'm getting a warning for something that I shouldn't be getting a warning for. (Also, I'm not sure if the savings calculated is accurate since I am using
modulepreload
).What is the expected behavior?
For scripts loaded via
<script type="module">
the recommendation should be to usemodulepreload
(or perhaps recommend using one or the other).Environment Information
Related issues
The text was updated successfully, but these errors were encountered: