next-plugins icon indicating copy to clipboard operation
next-plugins copied to clipboard

Styles not loaded.

Open loconluis opened this issue 8 years ago • 11 comments

Im using Next Js 6.0.x

When Im in Dev Mode my Stiles are loaded fine (im using sass)

But when I create a Build, Styles doest loaded, someone knows something about that??

loconluis avatar May 25 '18 02:05 loconluis

Might be related to #177

zachary95 avatar May 30 '18 19:05 zachary95

I'm having the same issue, but using Postcss.

jakeleboeuf avatar Jun 05 '18 12:06 jakeleboeuf

@jakeleboeuf the fix for plain css seemed to be to move the import to the page level, and not in the _document file, maybe this will work for postcss as well?

distractdiverge avatar Jun 07 '18 02:06 distractdiverge

make sure you update @zeit/next-sass and @zeit/next-css to 0.2.0, solves this issue

cryptiklemur avatar Jun 07 '18 03:06 cryptiklemur

None of the solutions worked for me. I got the problem when I use "node server.js". The style.css file is not created, only using in dev mode "next". I am also using sass.

euchicosousa avatar Jun 13 '18 03:06 euchicosousa

Any updates on this one? I have the same issue ? @and3rsonsousa

Ionut-Milas avatar Jun 30 '18 07:06 Ionut-Milas

Same issue

markolofsen avatar Jul 01 '18 01:07 markolofsen

What do you guys ee when you type npm ls @zeit/next-sass and npm ls @zeit/next-css?

cryptiklemur avatar Jul 01 '18 05:07 cryptiklemur

npm ls @zeit/next-sass └── @zeit/[email protected]

npm ls @zeit/next-css

├── @zeit/[email protected]
└─┬ @zeit/[email protected]
  └── @zeit/[email protected]  deduped

markolofsen avatar Jul 01 '18 13:07 markolofsen

@markolofsen @aequasi I have the same issue too. But I soon found that the reason of styles not loading while using react routing in dev mode, might be using multi type of css languages. In my case I used sass and css in the same _document.js. Problem was saolved when I only use sass.

I think the config might be related to the problem. Here's my config in next.config.js:

const withCSS = require('@zeit/next-css')
const withSass = require('@zeit/next-sass')
const commonsChunkConfig = require('@zeit/next-css/commons-chunk-config')

const config = withCSS(withSass({
  webpack: (config, {isServer}) => {
    if (!isServer) {
      config = commonsChunkConfig(config, /\.(sass|scss|css)$/)
    }
    return config
  }
}))

module.exports =  config

webtjw avatar Jul 10 '18 15:07 webtjw

@webtjw yes, I I prefered css in js instead sass — that's work.

markolofsen avatar Jul 12 '18 17:07 markolofsen