-1

I'm trying to do add postcss-loader to Angular 4 with platform-server rendering, I keep getting the error as below, basically what I'm trying to do is adding style.scss as global scss to my webpack process, similar the way it's working in cli...

 ERROR in ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-loader/lib?{}!./~/sass-loader/lib/loader.js!./src/styles.scss
        Module build failed: Error: No PostCSS Config found in: /Users/alireza.dezfoolian/Desktop/Angular 4/web-app/src
            at /Users/alireza.dezfoolian/Desktop/Angular 4/web-app/node_modules/postcss-load-config/index.js:51:26
Alireza
  • 100,211
  • 27
  • 269
  • 172

3 Answers3

0

Just use the sass-loader.

{
    test: /\.scss$/,
    use: ['to-string-loader', 'css-loader', 'sass-loader']
}
Dmitrij Kuba
  • 998
  • 9
  • 14
0

I think you need to add node-sass to your project. To install node-sass you need node-gyp globally installed. Check this installation part for node-gyp.

Robin Dijkhof
  • 18,665
  • 11
  • 65
  • 116
0

I also faced this problem and is because of the node-sass package. So, it is necessary to rebuild your node-sass package.

Run the cmd: npm rebuild node-sass to make sure it is ready.

See the below snippet of my ubuntu terminal:

asus@asus:~/Documents/demo$ npm rebuild node-sass                            

> node-sass@4.5.3 install /home/asus/Documents/demo/node_modules/node-sass   
> node scripts/install.js                                                    

Cached binary found at /home/asus/.npm/node-sass/4.5.3/linux-x64-48_binding.n
ode                                                                          

> node-sass@4.5.3 postinstall /home/asus/Documents/demo/node_modules/node-sas
s                                                                            
> node scripts/build.js                                                      

Binary found at /home/asus/Documents/demo/node_modules/node-sass/vendor/linux
-x64-48/binding.node                                                         
Testing binary                                                               
Binary is fine                                                               
node-sass@4.5.3 /home/asus/Documents/demo/node_modules/node-sass 

And my issue get resolved out!!!

solanki...
  • 4,982
  • 2
  • 27
  • 29