Preloaded js chunks not being used by browser.
See original GitHub issueBug report
Describe the bug
The preloaded js chunks don’t seem to be used by the browser and are redundant even with crossorigin attribute added.
Warnings: A preload <link> was found for "https://***/_next/static/chunks/***.js" but was not used by the browser. Check that you are using the `crossorigin` attribute properly. A preload <link> was found for "https://***/_next/static/chunks/***.js" but was not used by the browser. Check that you are using the `crossorigin` attribute properly. A preload <link> was found for "https://***/_next/static/chunks/***.js" but was not used by the browser. Check that you are using the `crossorigin` attribute properly.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Build for production.
- Run site through lighthouse.
- See error
Expected behavior
A clear and concise description of what you expected to happen.
The preload link should work without any complains from lighthouse otherwise is it even called correctly?
Screenshots
If applicable, add screenshots to help explain your problem.
System information
- Version of Next.js: [9.3.1]
Additional context
Add any other context about the problem here.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Code Splitting / Preloading Content while user is browsing?
Yes you can achieve this. I will show one of the possible solutions. Firstly let's create backgroundLoader for queuing required chunks:
Read more >Preload critical assets to improve loading speed - web.dev
Because browsers don't execute preloaded files, preloading is useful to separate fetching from execution which can improve metrics such as Time ...
Read more ><link rel=”prefetch/preload”> in webpack | by Tobias Koppers
What's the problem? The webpack runtime only takes care of prefetch/preload for on-demand-loaded chunks. When prefetch/preload is used in import ...
Read more >Code Splitting - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >Lazy loading - Web performance | MDN
Lazy loading is a strategy to identify resources as non-blocking ... splitting JavaScript, CSS and HTML can be split into smaller chunks.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

NextJS official doc got the same issue. https://developers.google.com/speed/pagespeed/insights/?hl=en&url=https%3A%2F%2Fnextjs.org%2Fdocs%2Fgetting-started
Same here with 9.5.3.
Here is the repo: https://github.com/BernardA/quiamo-client