Home > other >  NextJS - Global style in _app.js is not being applied
NextJS - Global style in _app.js is not being applied

Time:07-18

I just created a new project and followed this page from NextJS documentation: Project folder structure

And here is the page I get after running 'npm run dev':Loaded index page with no global styles applied

You can see that the page has none of the global styles and the body element's styles are also empty.

CodePudding user response:

I tried deleting the .next folder and restarting the server and it finally worked. I think the issue is that creating /pages/_app.js requires you to recreate the whole build and just restarting it without deleting .next entirely isn't enough.

CodePudding user response:

Sometimes browsers do cache style files. You can force browser to download new style file by refreshing page with Ctrl F5.

  • Related