Next.js: Preloaded js chunks not being used by browser.

Created on 20 Mar 2020  路  13Comments  路  Source: vercel/next.js

Bug 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  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  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  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:

  1. Build for production.
  2. Run site through lighthouse.
  3. 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.

please add a complete reproduction

All 13 comments

A complete reproduction is needed.

I'm just building and uploading my project in order to test in on Pagespeed insights, the error occurs in the passed audits -> Preload key requests section. At this time i cannot give a complete reproduction. It's a simple build with v9.3.1 default behaviour.

i have same error, https://github.com/drenther/next-pwa and check same step by tankpower1

Isn't it solved by this https://github.com/zeit/next.js/blob/4ce095df89139bc1dc777465de717a6cb545a923/packages/next/README.md#cdn-support-with-asset-prefix ?

<Head crossOrigin="anonymous">...</Head>
<body>
   <Main/>
   <NextScript crossOrigin="anonymous"/>
</body>

I've tried that exact solution and it didn't seem to change anything.

Then only a complete and minimal reproduction can help.

Can confirm i'm seeing this as well.

The links are for pages that im linking to using <Link href="/my-page-name" /> as described in the docs. If I remove the links then I don't see the warning in the page audit anymore. I have crossOrigin: "anonymous" in my next.config.js and im on [email protected]. Site is deployed using serverless-nextjs-component

This was resolved in Next.js 9.5+, please upgrade!

I'm still having this issue with Next.js 9.5+ using next export

Same here with 9.5.3.

Here is the repo: https://github.com/BernardA/quiamo-client

@Timer
I'm on version 9.5.3 and the problem is here in front of me.

This issue is being tracked here:
https://github.com/vercel/next.js/issues/16932

Was this page helpful?
0 / 5 - 0 ratings