I am moving from react js to Nextjs 13. I’m just creating a simple calculator application but it’s showing some warnings.
The resource http://localhost:3000/%20next/static/css/app/page.css?v=1688433441465 was preloaded using link preload but not used within a few seconds from the window’s load event. Please make sure it has an appropriate
as
value and it is preloaded intentionally.
Im creating individual CSS for every component.
2
Answers
Nextjs docs suggests two approches when working with multiple fonts:
First approach:
app/fonts.ts:
app/layout.tsx:
app/page.tsx:
Second approach
app/layout.tsx:
app/global.css:
following one of these two approaches the warning should disappear
Make sure you are using css modules if you are using multiple css file. Your css file should be named
your-styles.module.css
,.module.css|scss
is important.Then in your component