[build] gulp build command not working
gulp build can't complete the 'build-assets' phase due to the following error:
GulpUglifyError: unable to minify JavaScript
Caused by: DefaultsError: `preserveComments` is not a supported option
semantic/tasks/config/tasks.js:96
if(error.filename.match(/theme.less/)) {
^
TypeError: Cannot read property 'match' of undefined
And is NOT fixed by commenting the following lines:
./tasks/config/tasks.js:148: preserveComments : 'some'
./tasks/config/tasks.js:162: preserveComments : false
Steps to reproduce it:
npm install semantic-ui --save
cd semantic/
gulp build
would also like to see this answered as i am having the same issue. ⌛️
i tried to resolve this by downloading the semantic zip from the website.
although this zip does not contain everything and will still error out giving the following
This relative module was not found: *./themes/default/assets/images/loader-large.gif in ./~/css-loader?{"minimize":false,"sourceMap":false}!./semantic/dist/semantic.min.css
@simoncarbajal i fixed this by completely removing semantic and reinstalling it. not sure where the cause lies. :man_shrugging:
Fix is to change filename to fileName in line 96 of semantic/tasks/config/tasks.js
e.g. if(error.fileName.match(/theme.less/)) {
@tarkwyn Can you make a pull request to fix this?
I can confirm that @tarkwynl 's change worked for me. I can provide additional details if needed.
The camelCase issue didn't cause any problems, however I was unable to successfully gulp build until I commented out the two preserveComments tags in /semantic/tasks/config/tasks.js
The error (with "gulp-uglify": "^3.0.0"):
[13:56:35] Created: dist/components/site.js
[13:56:35] Plumber found unhandled error:
GulpUglifyError: unable to minify JavaScript
Caused by: DefaultsError: `preserveComments` is not a supported option
File: /Volumes/DATA/WWW/skilled/semantic/dist/components/site.js
@neokio I also received the perserveComments error, but I had to upgrade my version of node to the latest, to get pass that.
I will not very experienced with gulp/node so take my inputs with a grain of salt.
Interesting! Good advice in general, so I updated node from 7.7.1 to the latest (8.1.3), and reinstalled npm (npm install -g npm) just to be sure.
The above error still appears, unless I remove both perserveComments.
The error persists in 2.2.11 ... unable to successfully gulp build until I removed both preserveComments lines from /semantic/tasks/config/tasks.js.
@neokio could be unrelated, but when I said I updated to the latest for Node Js I actually went for LTS, not current. https://nodejs.org/en/ so I went on version 6.11.1
I think I found the problem. This issue ... https://github.com/terinjokes/gulp-uglify/issues/265 ... and the latest gulp-uglify release notes reveal that release v3.0.0 of gulp-uglify REMOVED the custom option preserveComments :)
Yep, can confirm the issue. Commenting out L148 & L162 (temporarily) solves it.
Tried with older version of Node / npm & latest version too. It's not camelCase related or node version related
After all, what will be done in the semantic ui ? To remove the option or comment and wait for uglify downgrade ?
I'll fix the dependencies so that we dont use this version of uglify. Sorry about this guys.
I'm a little late to the party, but I figure another confirmation can't hurt. Commenting out L148 & L162 worked for me as well. Thanks!
Commenting out L148 & L162. It worked for me too.
Commenting out L148 & L162. It worked for me too.
Commenting out only worked , can't find out if issue is in gulp-uglify or semantic ui.
Will get fix in over weekend. Thanks for patience.