css-loader version: 0.23.1
ERROR in ../~/css-loader!./css/index.css
Module build failed: Error: Unexpected "space" found.
at new error (/usr/src/app/node_modules/css-loader/node_modules/cssnano/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/processor.js:27:23)
at Parser.error (/usr/src/app/node_modules/css-loader/node_modules/cssnano/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:212:15)
at Parser.pseudo (/usr/src/app/node_modules/css-loader/node_modules/cssnano/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:320:18)
at Parser.parse (/usr/src/app/node_modules/css-loader/node_modules/cssnano/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:502:22)
at Parser.loop (/usr/src/app/node_modules/css-loader/node_modules/cssnano/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:470:18)
at new Parser (/usr/src/app/node_modules/css-loader/node_modules/cssnano/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/parser.js:89:21)
at Processor.process (/usr/src/app/node_modules/css-loader/node_modules/cssnano/node_modules/postcss-minify-selectors/node_modules/postcss-selector-parser/dist/processor.js:24:21)
at getParsed (/usr/src/app/node_modules/css-loader/node_modules/cssnano/node_modules/postcss-minify-selectors/dist/index.js:28:59)
at optimise (/usr/src/app/node_modules/css-loader/node_modules/cssnano/node_modules/postcss-minify-selectors/dist/index.js:38:21)
at /usr/src/app/node_modules/css-loader/node_modules/postcss/lib/container.js:110:28
at /usr/src/app/node_modules/css-loader/node_modules/postcss/lib/container.js:73:26
at Root.each (/usr/src/app/node_modules/css-loader/node_modules/postcss/lib/container.js:60:22)
at Root.walk (/usr/src/app/node_modules/css-loader/node_modules/postcss/lib/container.js:72:21)
at Root.walkRules (/usr/src/app/node_modules/css-loader/node_modules/postcss/lib/container.js:108:25)
at /usr/src/app/node_modules/css-loader/node_modules/cssnano/node_modules/postcss-minify-selectors/dist/index.js:107:20
at LazyResult.run (/usr/src/app/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:206:20)
at /usr/src/app/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:120:37
at LazyResult.asyncTick (/usr/src/app/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:134:15)
at /usr/src/app/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:132:27
at LazyResult.asyncTick (/usr/src/app/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:134:15)
at /usr/src/app/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:132:27
at LazyResult.asyncTick (/usr/src/app/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:134:15)
at /usr/src/app/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:132:27
at LazyResult.asyncTick (/usr/src/app/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:134:15)
at /usr/src/app/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:132:27
at LazyResult.asyncTick (/usr/src/app/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:134:15)
at /usr/src/app/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:132:27
at LazyResult.asyncTick (/usr/src/app/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:134:15)
at /usr/src/app/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:132:27
at LazyResult.asyncTick (/usr/src/app/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:134:15)
@ ./css/index.css 4:14-79
Can you help me solve this bug?
Plz view the log: @ ./css/index.css 4:14-79
@hujb2000 Have you fixed the issue? I am having the same problem here. Seems like some kind of PostCSS misconfiguration.
I have similar symptoms, and in my case it seems to be caused by a function definition in my scss.
Btw, I only run into this now that I am trying to use ExtractTextPlugin, the code works by itself otherwise
$clr-success: $green;
$light-gray-2: #E4E4E4;
$colors: (
globalBackground: $light-gray-2,
....
);
// usage example: body { background: color(globalBackground); }
// problematic block starts here
@function color($key) {
@if map-has-key($colors, $key) {
@return map-get($colors, $key);
}
@warn "Unknown `#{$key}` in $colors.";
@return null;
}
// poblematic blockends here
The error is thrown in postcss-selector-parser/dist/parser.js, Parser.prototype.pseudo = function pseudo() {},
if (this.currToken[0] === 'word') { ... } else { this.error('Unexpected "' + this.currToken[0] + '" found.'); }
curToken[0] is actually "space"... somehow.. and when i remove that @function definition in my scss, the error is not thrown anymore.
(css-loader 0.21.0)
Error message:
Error during compilation { [ModuleBuildError: Module build failed: Error: Unexpected "space" found.
at new error (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-selector-parser\dist\pro
cessor.js:27:23)
at Parser.error (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-selector-parser\dist\
parser.js:212:15)
at Parser.pseudo (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-selector-parser\dist
\parser.js:321:18)
at Parser.parse (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-selector-parser\dist\
parser.js:503:22)
at Parser.loop (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-selector-parser\dist\p
arser.js:471:18)
at new Parser (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-selector-parser\dist\pa
rser.js:89:21)
at Processor.process (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-selector-parser\
dist\processor.js:24:21)
at getParsed (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-minify-selectors\dist\in
dex.js:28:59)
at optimise (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-minify-selectors\dist\ind
ex.js:38:21)
at D:\Projects\xai-nisv\client\client-core\node_modules\postcss\lib\container.js:110:28
at D:\Projects\xai-nisv\client\client-core\node_modules\postcss\lib\container.js:73:26
at Root.each (D:\Projects\xai-nisv\client\client-core\node_modules\postcss\lib\container.js:60:22)
at Root.walk (D:\Projects\xai-nisv\client\client-core\node_modules\postcss\lib\container.js:72:21)
at Root.walkRules (D:\Projects\xai-nisv\client\client-core\node_modules\postcss\lib\container.js:10
8:25)
at D:\Projects\xai-nisv\client\client-core\node_modules\postcss-minify-selectors\dist\index.js:107:
20
at LazyResult.run (D:\Projects\xai-nisv\client\client-core\node_modules\postcss\lib\lazy-result.js:
206:20)]
name: 'ModuleBuildError',
message: 'Module build failed: Error: Unexpected "space" found.\n at new error (D:\\Projects\\xai-
nisv\\client\\client-core\\node_modules\\postcss-selector-parser\\dist\\processor.js:27:23)\n at Par
ser.error (D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postcss-selector-parser\\dist\\pa
rser.js:212:15)\n at Parser.pseudo (D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postc
ss-selector-parser\\dist\\parser.js:321:18)\n at Parser.parse (D:\\Projects\\xai-nisv\\client\\clien
t-core\\node_modules\\postcss-selector-parser\\dist\\parser.js:503:22)\n at Parser.loop (D:\\Project
s\\xai-nisv\\client\\client-core\\node_modules\\postcss-selector-parser\\dist\\parser.js:471:18)\n a
t new Parser (D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postcss-selector-parser\\dist\
\parser.js:89:21)\n at Processor.process (D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\
\postcss-selector-parser\\dist\\processor.js:24:21)\n at getParsed (D:\\Projects\\xai-nisv\\client\\
client-core\\node_modules\\postcss-minify-selectors\\dist\\index.js:28:59)\n at optimise (D:\\Projec
ts\\xai-nisv\\client\\client-core\\node_modules\\postcss-minify-selectors\\dist\\index.js:38:21)\n a
t D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postcss\\lib\\container.js:110:28\n at
D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postcss\\lib\\container.js:73:26\n at Roo
t.each (D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postcss\\lib\\container.js:60:22)\n
at Root.walk (D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postcss\\lib\\container.js:
72:21)\n at Root.walkRules (D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postcss\\lib\
\container.js:108:25)\n at D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postcss-minify
-selectors\\dist\\index.js:107:20\n at LazyResult.run (D:\\Projects\\xai-nisv\\client\\client-core\\
node_modules\\postcss\\lib\\lazy-result.js:206:20)',
module:
DependenciesBlock {
dependencies: [],
blocks: [],
variables: [],
context: 'D:\\Projects\\xai-nisv\\client\\client-core\\src\\styles',
reasons: [ [Object] ],
debugId: 1216,
lastId: -1,
id: null,
index: null,
index2: null,
chunks: [],
warnings: [],
dependenciesWarnings: [],
errors: [],
dependenciesErrors: [],
request: 'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\css-loader\\index.js!D:\\Proj
ects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss',
userRequest: 'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\css-loader\\index.js!D:\\
Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss',
rawRequest: '!!./../../node_modules/css-loader/index.js!./main.scss',
parser:
Parser {
_plugins: [Object],
options: undefined,
scope: undefined,
state: undefined,
_currentPluginApply: undefined },
resource: 'D:\\Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss',
loaders: [ 'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\css-loader\\index.js' ],
fileDependencies: [ 'D:\\Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss' ],
contextDependencies: [],
error: [Circular],
_source: null,
meta: {},
assets: {},
built: true,
_cachedSource: null,
profile: { factory: 0 },
issuer: 'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\extract-text-webpack-plugin\\l
oader.js?{"0":"s","1":"a","2":"s","3":"s","4":"-","5":"l","6":"o","7":"a","8":"d","9":"e","10":"r","omi
t":1,"extract":true,"remove":true,"id":2}!D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\st
yle-loader\\index.js!D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\css-loader\\index.js!D:
\\Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss',
optional: false,
useSourceMap: true,
building: undefined,
buildTimestamp: 1460903571704,
cacheable: true },
error: [Error: Unexpected "space" found.],
dependencies:
[ CommonJsRequireDependency {
module: [Object],
request: '!!./../../node_modules/css-loader/index.js!./main.scss',
userRequest: '!!./../../node_modules/css-loader/index.js!./main.scss',
range: [Object],
loc: [Object],
optional: false } ],
origin:
DependenciesBlock {
dependencies: [ [Object], [Object], [Object], [Object], [Object] ],
blocks: [],
variables: [],
context: 'D:\\Projects\\xai-nisv\\client\\client-core\\src\\styles',
reasons: [ [Object] ],
debugId: 1215,
lastId: -1,
id: null,
index: null,
index2: null,
chunks: [],
warnings: [],
dependenciesWarnings: [],
errors: [],
dependenciesErrors: [ [Circular] ],
request: 'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\extract-text-webpack-plugin\\
loader.js?{"0":"s","1":"a","2":"s","3":"s","4":"-","5":"l","6":"o","7":"a","8":"d","9":"e","10":"r","om
it":1,"extract":true,"remove":true,"id":2}!D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\s
tyle-loader\\index.js!D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\css-loader\\index.js!D
:\\Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss',
userRequest: 'D:\\Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss',
rawRequest: 'styles/main.scss',
parser:
Parser {
_plugins: [Object],
options: undefined,
scope: undefined,
state: undefined,
_currentPluginApply: undefined },
resource: 'D:\\Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss',
loaders:
[ 'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\extract-text-webpack-plugin\\loader
.js?{"0":"s","1":"a","2":"s","3":"s","4":"-","5":"l","6":"o","7":"a","8":"d","9":"e","10":"r","omit":1,
"extract":true,"remove":true,"id":2}',
'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\style-loader\\index.js',
'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\css-loader\\index.js' ],
fileDependencies: [ 'D:\\Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss' ],
contextDependencies: [],
error: null,
_source:
OriginalSource {
_value: '// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the style
s\nvar content = require("!!./../../node_modules/css-loader/index.js!./main.scss");\nif(typeof content
=== \'string\') content = [[module.id, content, \'\']];\n// add the styles to the DOM\nvar update = req
uire("!./../../node_modules/style-loader/addStyles.js")(content, {});\nif(content.locals) module.export
s = content.locals;\n// Hot Module Replacement\nif(module.hot) {\n\t// When the styles change, update t
he <style> tags\n\tif(!content.locals) {\n\t\tmodule.hot.accept("!!./../../node_modules/css-loader/inde
x.js!./main.scss", function() {\n\t\t\tvar newContent = require("!!./../../node_modules/css-loader/inde
x.js!./main.scss");\n\t\t\tif(typeof newContent === \'string\') newContent = [[module.id, newContent, \
'\']];\n\t\t\tupdate(newContent);\n\t\t});\n\t}\n\t// When the module is disposed, remove the <style> t
ags\n\tmodule.hot.dispose(function() { update(); });\n}',
_name: 'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\extract-text-webpack-plugin\
\loader.js?{"0":"s","1":"a","2":"s","3":"s","4":"-","5":"l","6":"o","7":"a","8":"d","9":"e","10":"r","o
mit":1,"extract":true,"remove":true,"id":2}!D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\
style-loader\\index.js!D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\css-loader\\index.js!
D:\\Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss' },
meta: { 'D:\Projects\xai-nisv\client\client-core\node_modules\extract-text-webpack-plugin': [Objec
t] },
assets: {},
built: true,
_cachedSource: null,
profile: { factory: 1518, building: 46 },
issuer: 'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\babel-loader\\index.js?{"prese
ts":["stage-0","es2015","react"],"plugins":["transform-class-properties","transform-decorators-legacy",
"transform-flow-strip-types",["react-intl",{"messagesDir":"./dist/intl/","enforceDescriptions":false}]]
}!D:\\Projects\\xai-nisv\\client\\client-core\\src\\empty.js',
optional: false,
useSourceMap: true,
building: undefined,
buildTimestamp: 1460903571658,
cacheable: true } }
{ [ModuleBuildError: Module build failed: Error: Unexpected "space" found.
at new error (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-selector-parser\dist\pro
cessor.js:27:23)
at Parser.error (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-selector-parser\dist\
parser.js:212:15)
at Parser.pseudo (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-selector-parser\dist
\parser.js:321:18)
at Parser.parse (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-selector-parser\dist\
parser.js:503:22)
at Parser.loop (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-selector-parser\dist\p
arser.js:471:18)
at new Parser (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-selector-parser\dist\pa
rser.js:89:21)
at Processor.process (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-selector-parser\
dist\processor.js:24:21)
at getParsed (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-minify-selectors\dist\in
dex.js:28:59)
at optimise (D:\Projects\xai-nisv\client\client-core\node_modules\postcss-minify-selectors\dist\ind
ex.js:38:21)
at D:\Projects\xai-nisv\client\client-core\node_modules\postcss\lib\container.js:110:28
at D:\Projects\xai-nisv\client\client-core\node_modules\postcss\lib\container.js:73:26
at Root.each (D:\Projects\xai-nisv\client\client-core\node_modules\postcss\lib\container.js:60:22)
at Root.walk (D:\Projects\xai-nisv\client\client-core\node_modules\postcss\lib\container.js:72:21)
at Root.walkRules (D:\Projects\xai-nisv\client\client-core\node_modules\postcss\lib\container.js:10
8:25)
at D:\Projects\xai-nisv\client\client-core\node_modules\postcss-minify-selectors\dist\index.js:107:
20
at LazyResult.run (D:\Projects\xai-nisv\client\client-core\node_modules\postcss\lib\lazy-result.js:
206:20)]
name: 'ModuleBuildError',
message: 'Module build failed: Error: Unexpected "space" found.\n at new error (D:\\Projects\\xai-
nisv\\client\\client-core\\node_modules\\postcss-selector-parser\\dist\\processor.js:27:23)\n at Par
ser.error (D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postcss-selector-parser\\dist\\pa
rser.js:212:15)\n at Parser.pseudo (D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postc
ss-selector-parser\\dist\\parser.js:321:18)\n at Parser.parse (D:\\Projects\\xai-nisv\\client\\clien
t-core\\node_modules\\postcss-selector-parser\\dist\\parser.js:503:22)\n at Parser.loop (D:\\Project
s\\xai-nisv\\client\\client-core\\node_modules\\postcss-selector-parser\\dist\\parser.js:471:18)\n a
t new Parser (D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postcss-selector-parser\\dist\
\parser.js:89:21)\n at Processor.process (D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\
\postcss-selector-parser\\dist\\processor.js:24:21)\n at getParsed (D:\\Projects\\xai-nisv\\client\\
client-core\\node_modules\\postcss-minify-selectors\\dist\\index.js:28:59)\n at optimise (D:\\Projec
ts\\xai-nisv\\client\\client-core\\node_modules\\postcss-minify-selectors\\dist\\index.js:38:21)\n a
t D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postcss\\lib\\container.js:110:28\n at
D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postcss\\lib\\container.js:73:26\n at Roo
t.each (D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postcss\\lib\\container.js:60:22)\n
at Root.walk (D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postcss\\lib\\container.js:
72:21)\n at Root.walkRules (D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postcss\\lib\
\container.js:108:25)\n at D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\postcss-minify
-selectors\\dist\\index.js:107:20\n at LazyResult.run (D:\\Projects\\xai-nisv\\client\\client-core\\
node_modules\\postcss\\lib\\lazy-result.js:206:20)',
module:
DependenciesBlock {
dependencies: [],
blocks: [],
variables: [],
context: 'D:\\Projects\\xai-nisv\\client\\client-core\\src\\styles',
reasons: [ [Object] ],
debugId: 1216,
lastId: -1,
id: null,
index: null,
index2: null,
chunks: [],
warnings: [],
dependenciesWarnings: [],
errors: [],
dependenciesErrors: [],
request: 'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\css-loader\\index.js!D:\\Proj
ects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss',
userRequest: 'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\css-loader\\index.js!D:\\
Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss',
rawRequest: '!!./../../node_modules/css-loader/index.js!./main.scss',
parser:
Parser {
_plugins: [Object],
options: undefined,
scope: undefined,
state: undefined,
_currentPluginApply: undefined },
resource: 'D:\\Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss',
loaders: [ 'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\css-loader\\index.js' ],
fileDependencies: [ 'D:\\Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss' ],
contextDependencies: [],
error: [Circular],
_source: null,
meta: {},
assets: {},
built: true,
_cachedSource: null,
profile: { factory: 0 },
issuer: 'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\extract-text-webpack-plugin\\l
oader.js?{"0":"s","1":"a","2":"s","3":"s","4":"-","5":"l","6":"o","7":"a","8":"d","9":"e","10":"r","omi
t":1,"extract":true,"remove":true,"id":2}!D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\st
yle-loader\\index.js!D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\css-loader\\index.js!D:
\\Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss',
optional: false,
useSourceMap: true,
building: undefined,
buildTimestamp: 1460903571704,
cacheable: true },
error: [Error: Unexpected "space" found.],
dependencies:
[ CommonJsRequireDependency {
module: [Object],
request: '!!./../../node_modules/css-loader/index.js!./main.scss',
userRequest: '!!./../../node_modules/css-loader/index.js!./main.scss',
range: [Object],
loc: [Object],
optional: false } ],
origin:
DependenciesBlock {
dependencies: [ [Object], [Object], [Object], [Object], [Object] ],
blocks: [],
variables: [],
context: 'D:\\Projects\\xai-nisv\\client\\client-core\\src\\styles',
reasons: [ [Object] ],
debugId: 1215,
lastId: -1,
id: null,
index: null,
index2: null,
chunks: [],
warnings: [],
dependenciesWarnings: [],
errors: [],
dependenciesErrors: [ [Circular] ],
request: 'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\extract-text-webpack-plugin\\
loader.js?{"0":"s","1":"a","2":"s","3":"s","4":"-","5":"l","6":"o","7":"a","8":"d","9":"e","10":"r","om
it":1,"extract":true,"remove":true,"id":2}!D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\s
tyle-loader\\index.js!D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\css-loader\\index.js!D
:\\Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss',
userRequest: 'D:\\Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss',
rawRequest: 'styles/main.scss',
parser:
Parser {
_plugins: [Object],
options: undefined,
scope: undefined,
state: undefined,
_currentPluginApply: undefined },
resource: 'D:\\Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss',
loaders:
[ 'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\extract-text-webpack-plugin\\loader
.js?{"0":"s","1":"a","2":"s","3":"s","4":"-","5":"l","6":"o","7":"a","8":"d","9":"e","10":"r","omit":1,
"extract":true,"remove":true,"id":2}',
'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\style-loader\\index.js',
'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\css-loader\\index.js' ],
fileDependencies: [ 'D:\\Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss' ],
contextDependencies: [],
error: null,
_source:
OriginalSource {
_value: '// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the style
s\nvar content = require("!!./../../node_modules/css-loader/index.js!./main.scss");\nif(typeof content
=== \'string\') content = [[module.id, content, \'\']];\n// add the styles to the DOM\nvar update = req
uire("!./../../node_modules/style-loader/addStyles.js")(content, {});\nif(content.locals) module.export
s = content.locals;\n// Hot Module Replacement\nif(module.hot) {\n\t// When the styles change, update t
he <style> tags\n\tif(!content.locals) {\n\t\tmodule.hot.accept("!!./../../node_modules/css-loader/inde
x.js!./main.scss", function() {\n\t\t\tvar newContent = require("!!./../../node_modules/css-loader/inde
x.js!./main.scss");\n\t\t\tif(typeof newContent === \'string\') newContent = [[module.id, newContent, \
'\']];\n\t\t\tupdate(newContent);\n\t\t});\n\t}\n\t// When the module is disposed, remove the <style> t
ags\n\tmodule.hot.dispose(function() { update(); });\n}',
_name: 'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\extract-text-webpack-plugin\
\loader.js?{"0":"s","1":"a","2":"s","3":"s","4":"-","5":"l","6":"o","7":"a","8":"d","9":"e","10":"r","o
mit":1,"extract":true,"remove":true,"id":2}!D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\
style-loader\\index.js!D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\css-loader\\index.js!
D:\\Projects\\xai-nisv\\client\\client-core\\src\\styles\\main.scss' },
meta: { 'D:\Projects\xai-nisv\client\client-core\node_modules\extract-text-webpack-plugin': [Objec
t] },
assets: {},
built: true,
_cachedSource: null,
profile: { factory: 1518, building: 46 },
issuer: 'D:\\Projects\\xai-nisv\\client\\client-core\\node_modules\\babel-loader\\index.js?{"prese
ts":["stage-0","es2015","react"],"plugins":["transform-class-properties","transform-decorators-legacy",
"transform-flow-strip-types",["react-intl",{"messagesDir":"./dist/intl/","enforceDescriptions":false}]]
}!D:\\Projects\\xai-nisv\\client\\client-core\\src\\empty.js',
optional: false,
useSourceMap: true,
building: undefined,
buildTimestamp: 1460903571658,
cacheable: true } }
We also managed to find the issue. The real problem here is that the original error message does not show up the the log, so the user has ho idea on what to fix. I our case it was invalid LESS-like comment in a postcss stylesheet.
@tj @seaneking
I ran into the same error. I am using stylus, extractText and postcss (via poststylus)
Bundling the css works when I'm in dev mode. The error appears only when I try to bundle a production version. The only difference between those two setups is the UglifyJsPlugin
I had a typo in my .styl file (tab instead of space). So stylus thought I was starting a new selector and split my nested block in the middle. Obviously, it lets me write whatever I want. It created something like;
.foo {
color: white;
margin: 0 auto;
}
border-radius {
0.5rem;
}
That gets passed to postcss plugins afterwards. _That_ throws the error (as mentioned above)
It's no plugin's bug. Just that they are too trusting of my human errors.
Thus, I solved it and learned to check my .styl files carefully for indentation in the future.
The fact remains that we need some kind of error reporting to track the issue. My thinking is; either stylus should warn when you mix tabs/spaces (which is valid but might be unintended) or poststylus should log out the chunk of CSS it had trouble parsing.
p.s. That comment is all over the place. The gist of it is; I could bundle it _with the typo_ if I didn't use the UglifyJSPlugin. If I wanted to re-enable minifiying, I had to fix the typo.
i have same proble, because my syntax is error;
/*error*/
:global (
#app {
height: 100%;
}
)
/*right*/
:global {
#app {
height: 100%;
}
}
i hope cant help some people
I removed all of the comments in the CSS files and this fixed the issue for me.
@timhjellum thanks! That worked for me 馃槅
Hello, I think I found the same thing. I tried the idea from @timhjellum but it didn't work. I also didn't get which css file that failed.
Module build failed: Error: Unexpected "space" found.
at new error (/some_folder/another_folder/myapp/node_modules/postcss-selector-parser/dist/processor.js:29:23)
at Parser.error (/some_folder/another_folder/myapp/node_modules/postcss-selector-parser/dist/parser.js:234:15) etc.
It turned out that there were spaces in syntax like this .grid: not(.no-bp) [class*=col-]. Notice the space between ':' and "not". After I removed the space, the app could compile. Hope this helps.
not working bro @anwari32 i notice the spaces and after removing them it shows same error again
@smacky197 can your provide minimal reproducible test repo?
@monsterooo thanks!
for me it only worked like this:
:global #app {
height: 100%;
}
For me it was just a forgotten semicolon at the end of a nested block. It worked in dev mode but failed during minification on production.
````
.className {
padding: 3px;
margin: 0 10px /note the missing semicolon at end of this line/
subClass {
margin: 0;
}
}
````
I guess what we all would appreciate is better description of what went wrong, when it goes wrong..
@abimelex known issue, need stable release cssnano@4
This error is clearly a CSS error, but if you use many libs from third parties as was my case, finding it is like looking for a needle in a haystack, my solution was to go to the file: "node_modules/postcss-elector-arser/dist/processor.js" and on line 29 where the error is launched with a very generic message I just add to the error message the "selectors" variable that has the selectors that are be parsing:
original:
Line 29: throw new Error (e);
Updated by:
Line 29: throw new Error (e + "in selectors:" + selectors);
Using this way it is possible to see which CSS selectors have the error and correct it.
This was my solution to solve the problem, I hope it helps others because for me it was a waste of 2 days of hard work.
I just ran into this as well. My issue was:
@media screen and (min-width: 769px) {
nav: hover { /* extra space on this line*/
color: #313b44;
}
}
Out of scope css-loader, should be fixed in cssnano, also seems need release stable cssnano@4 version :+1:
Most helpful comment
This error is clearly a CSS error, but if you use many libs from third parties as was my case, finding it is like looking for a needle in a haystack, my solution was to go to the file: "node_modules/postcss-elector-arser/dist/processor.js" and on line 29 where the error is launched with a very generic message I just add to the error message the "selectors" variable that has the selectors that are be parsing:
original:
Line 29: throw new Error (e);Updated by:
Line 29: throw new Error (e + "in selectors:" + selectors);Using this way it is possible to see which CSS selectors have the error and correct it.
This was my solution to solve the problem, I hope it helps others because for me it was a waste of 2 days of hard work.