Fomantic ui is unable to build from a fresh npm install
npm init a new directorynpm i -D gulp fomantic-uinpx gulp build --gulpfile semantic/gulpfile.js --cwd semantic/Successful build
A build that succeeds until it tries to build the table css:
[PluginError: Cannot create property '_index' on string '!important' in file /home/david/src/test/semantic/src/themes/default/collections/table.variables line no. 1] {
message: "Cannot create property '_index' on string '!important' in file /home/david/src/test/semantic/src/themes/default/collections/table.variables line no. 1",
stack: undefined,
type: 'Syntax',
filename: '/home/david/src/test/semantic/src/themes/default/collections/table.variables',
index: NaN,
line: 1,
column: -1,
callLine: NaN,
callExtract: undefined,
extract: [
undefined,
'/*******************************',
' Table'
],
lineNumber: 1,
fileName: '/home/david/src/test/semantic/src/themes/default/collections/table.variables',
name: 'Error',
plugin: 'gulp-less',
showProperties: true,
showStack: false,
__safety: { toString: [Function: bound ] }
}
node 12.8.0 (also tested 10.16.2; same error)
npm 6.10.2
fomantic-ui 2.7.7
gulp 4.0.2
EDIT: looks like someone else is encountering a similar error, it may be because the table.variables is the only file with !important https://stackoverflow.com/questions/57568988/gulp-less-fails-when-using-important
~This issue is resolved if i npm install -D gulp-less@3. Not sure if this is ideal, but worth noting.~
The above is only true in the base semantic repository. There are other dependency issues afoot.
Looks like it's precisely what's happening here https://github.com/fomantic/Fomantic-UI/pull/939
npm i -D less@~3.9.0 fixes it
It seems that upstream issue in less.js.
Ref: https://github.com/less/less.js/issues/3423
Fixed by less 3.10.3 in #950
This issue is fixed in fresh installs, so I'll to go ahead and close it
Most helpful comment
Fixed by less 3.10.3 in #950