Skip to content

Webpack import sass issue #536

@webpack-bot

Description

@webpack-bot

Do you want to request a feature or report a bug?

What is the current behavior?

If the current behavior is a bug, please provide the steps to reproduce.

ERROR in ./~/css-loader!./~/sass-loader/lib/loader.js!./~/style-loader!./~/css-loader!./~/sass-loader/lib/loader.js!./~/postcss-loader!./~/extract-text-webpack-plugin/loader.js?{"omit":1,"remove":true}!./~/style-loader!./~/css-loader?minimize!./~/sass-loader/lib/loader.js!./~/postcss-loader!./src/index.scss
Module build failed: 
 @import 'css/base.scss';
^
      Invalid CSS after "...load the styles": expected 1 selector or at-rule, was "var content = requi"
      in /Users/df/Documents/my_apps_yo/personal_page/src/index.scss (line 1, column 1)
 @ ./~/style-loader!./~/css-loader!./~/sass-loader/lib/loader.js!./src/index.scss 4:14-502 13:2-17:4 14:20-508
 @ ./src/index.js
 @ multi webpack/hot/dev-server webpack-hot-middleware/client ./src/index

What is the expected behavior?
I star getting that error from out of the wild, like two weeks ago, this code was working fine
my webpack config has
`const webpack = require('webpack');
const conf = require('./gulp.conf');
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const FailPlugin = require('webpack-fail-plugin');
const autoprefixer = require('autoprefixer');

module.exports = {
module: {
loaders: [
{
test: /.json$/,
loaders: [
'json-loader'
]
},
{
test: /.js$/,
exclude: /node_modules/,
loader: 'eslint-loader',
enforce: 'pre'
},
{
test: /.(css|scss)$/,
loaders: [
'style-loader',
'css-loader',
'sass-loader',
'postcss-loader'
]
},
{
test: /.(css|scss)$/,
loaders: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader?minimize!sass-loader!postcss-loader'
})
},
{
test: /.js$/,
exclude: /node_modules/,
loaders: [
'react-hot-loader',
'babel-loader'
]
}
]
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
FailPlugin,
new ExtractTextPlugin('index.css'),
new HtmlWebpackPlugin({
template: conf.path.src('index.html')
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.LoaderOptionsPlugin({
options: {
postcss: () => [autoprefixer]
},
debug: true
})
],
devtool: 'source-map',
output: {
path: path.join(process.cwd(), conf.paths.tmp),
filename: 'index.js'
},
entry: [
'webpack/hot/dev-server',
'webpack-hot-middleware/client',
./${conf.path.src('index')}
]
};`

my index.css has
@import 'css/base.scss';
and my index.js has
import 'style-loader!css-loader!sass-loader!./index.scss';
If this is a feature request, what is motivation or use case for changing the behavior?
Im using yeoman fountain web-app to scaffold project, did that to stop loading styles from web and start loading my own styles, which was not as simple as I thought
Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.


This issue was moved from webpack/webpack#6457 by @evilebottnawi. Orginal issue was by @DFallas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions