6

My app.scss

.tes {
    color: red;
}

The output error when I execute ./node_modules/.bin/webpack

ERROR in ./~/css-loader!./~/sass-loader?indentedSyntax!./www/assets/app.scss
Module build failed: 
.tes {
     ^
      Invalid CSS after ".tes {": expected "}", was "{"
      in ./www/assets/app.scss (line 1, column 7)
 @ ./www/assets/app.scss 4:14-135 13:2-17:4 13:2-17:4 14:20-141

My webpack.config

 module: {
        loaders: [
            {
                test: /\.scss$/,
                loader: 'style!css!sass?indentedSyntax'
            },
            {
                test: /\.css$/,
                loader: 'style!css'
            }, {
                test: /\.(woff|woff2|ttf|eot|svg)(\?]?.*)?$/,
                loader: 'file-loader?name=res/[name].[ext]?[hash]'
            }
        ]
    },

And my app.js

require('./www/assets/app.scss');

var angular = require('angular');
var uiRouter = require('angular-ui-router');
require('velocity-animate');
require('node-lumx');

var HomeController = require('./www/components/home/homeController');

angular.module('app', ['lumx', uiRouter]) 
... //OMITED
ridermansb
  • 10,779
  • 24
  • 115
  • 226
  • 2
    Since you are using the `sass` loader with option `indentedSyntax` I think that it is expecting you to use the sass indented syntax which does not use braces but whitespace: http://sass-lang.com/documentation/file.INDENTED_SYNTAX.html – Explosion Pills Nov 02 '15 at 22:34
  • This correct.. thanks! You fix my problem..but another erro apper `Uncaught SyntaxError: missing ) after argument list` but on browser only. – ridermansb Nov 02 '15 at 22:45
  • 1
    @ExplosionPills, You should add that as an answer. It is the correct answer. It also helped me. Thanks! – Jake May 24 '16 at 05:18

2 Answers2

2

Try using sass loader without the option "indentedSyntax" as 'style!css!sass'

More info you can read the docs here: http://sass-lang.com/documentation/file.INDENTED_SYNTAX.html

1

The solution would be to change your file extension to sass if you want to use sass syntax because as of version 3.2.0, sass-loader will derive the style you want to use from the file extension. It worked for me.

ghsamm
  • 76
  • 2