ant-design / ant-design-mobile

Essential UI blocks for building mobile web apps.
https://mobile.ant.design
MIT License
11.61k stars 2.39k forks source link

The resource http://localhost:3000/_next/static/css/app/page.css was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it wasn't preloaded for nothing. #6411

Closed Looxor closed 10 months ago

Looxor commented 10 months ago

Version of antd-mobile

5.33.0

Description

Hi ,

I'm using the latest version of Next.js 13.5.6 (with the App Router config).

I notice the following warning on startup: "_The resource http://localhost:3000/_next/static/css/app/page.css?v=1698153426146 was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it wasn't preloaded for nothing._"

When I inspect the generated CSS file (http://localhost:3000/_next/static/css/app/page.css), I see that all the classes of Ant-Design CSS classes are in the "Page CSS" file generated, along with the custom CSS classes i added for the homepage. I've configured Babel to avoid having them, but it still loads all the standard Ant-Design CSS classes into the "page.css" file systematically.

Capture d’écran 2023-10-24 à 15 57 53 Capture d’écran 2023-10-24 à 15 58 00 Capture d’écran 2023-10-24 à 16 01 04

If anyone has an idea, or a method to prevent the systematic loading of all the classes from the "Ant-Design Mobile" library. I'm all ears.