-
Notifications
You must be signed in to change notification settings - Fork 29.5k
Labels
ReactRelated to React.Related to React.UpstreamRelated to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.).Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.).
Description
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/kind-elbakyan-fgg4tv?workspaceId=ws_NduBwxz3MLYn31fcaz2JTB
To Reproduce
Import a .css file
Start the application in dev mode
A warning is logged for each css file:
<link rel=preload> must have a valid `as` value
Current vs. Expected behavior
Stylesheets should be correctly loaded, and not trigger a browser warning.
It appears because as="stylesheet" is not a valid as value. It should be style according to MDN.
<link rel="preload" href="/_next/static/chunks/%5Broot-of-the-server%5D__02ec3763._.css" as="stylesheet"/>
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:29 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6000
Available memory (MB): 16384
Available CPU cores: 10
Binaries:
Node: 22.20.0
npm: 10.8.2
Yarn: N/A
pnpm: 10.17.1
Relevant Packages:
next: 15.6.0-canary.45 // Latest available version is detected (15.6.0-canary.45).
eslint-config-next: N/A
react: 19.2.0
react-dom: 19.2.0
typescript: 5.9.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local), Vercel (Deployed), next start (local), Other (Deployed)
Additional context
The issue started showing up in 15.6.0-canary.32. Previous versions do not include a preload link for stylesheets.
Metadata
Metadata
Assignees
Labels
ReactRelated to React.Related to React.UpstreamRelated to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.).Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.).