Next.js: Unused CSS preload

Created on 8 Sep 2020  路  16Comments  路  Source: vercel/next.js

I've only just started getting this problem with a new nextjs app, where css files aren't preloaded, and therefore not used at all:

A preload for 'https://*******.vercel.app/_next/static/css/db098983a22a0aa338df.css' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.

I'm using sass modules, and this is with nextjs 9.5.3 and webpack 5 (but the same issue occurs with webpack 4). Any ideas?

_Originally posted by @howells in https://github.com/vercel/next.js/discussions/16850_

bug 5

Most helpful comment

same on "next": "^10.0.0",

All 16 comments

(Thanks @Timer!)

I'm facing the same issue but the project is currently using zeit@next-css and zeit@next-sass so I thought it was related to that. Since @howells is only using sass modules this issue seems to be not limited to sass modules (I'm not using modules) but its scope is more general?

Edit: Using 9.5.3 as well

Any update on this issue or workaround? I'm experiencing the same problem.

+1, and I'm using Next 9.5.3 with styled-components 5.2.0

In my case, after I followed these instructions for every Link that I had on my page, the problem resolved:
https://nextjs.org/docs/api-reference/next/link#if-the-child-is-a-custom-component-that-wraps-an-a-tag
https://nextjs.org/docs/api-reference/next/link#if-the-child-is-a-function-component

My Links contained either single StyledComponents or StyledComponents nested in FuntionalComponents.

edit: I was wrong, the problem still persists.

confirm, I have the same issue with 9.5.3

faced same issue with 9.5.3. managed to remove the warning after downgrading to 9.5.2. using "@zeit/next-less": "^1.0.1" and "@zeit/next-sass": "^1.0.1".

I also confirm the issue.
I have next.js 9.5.3, @zeit/next-css 1.0.1 and @zeit/next-sass 1.0.1

me to on next 9.5.3

"next": "^9.5.5",

no zeit packages.

only "sass": "^1.26.10",

same on "next": "^10.0.0",

I am having the same preload warning going from Next 9.5.2 to 10.0.0

This does not concern only css. Please see Lighthouse below:

Screenshot 2020-10-30 at 18 38 50

I'm facing the same issue. Running Next 10.0.0

I am having the same issue in 10.0.1 and even 10.0.2-canary.8

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Timer picture Timer  路  60Comments

timneutkens picture timneutkens  路  250Comments

tomaswitek picture tomaswitek  路  73Comments

poyiding picture poyiding  路  73Comments

rauchg picture rauchg  路  208Comments