question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[build] gulp build command not working

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:41 (8 by maintainers)

github_iconTop GitHub Comments

13reactions
sergiomar73commented, Aug 2, 2017

Hi, I found that Uglify plugin changed its options and now preserveComments is obsolete:

https://github.com/gruntjs/grunt-contrib-uglify#deprecated-options-from-2x

Option           | Replacement
preserveComments | output.comments

So, just replacing in these 2 lines in semantic/tasks/config/tasks.js:

./tasks/config/tasks.js:148:      preserveComments : 'some'
./tasks/config/tasks.js:162:      preserveComments : false

with:

output: {
    comments: 'some'
}

output: {
    comments: false
}

worked for me.

11reactions
designosiscommented, Jul 11, 2017

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 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Quick fix for "gulp: command not found" error
Quick fix for “gulp: command not found” error · Install the gulp-cli globally · Check that you have npm installed in the /usr/local...
Read more >
gulp command not found - error after installing gulp
You forgot to install the gulp-cli package: npm install -g gulp-cli. Then you can run the command "gulp" from the command line.
Read more >
gulp: command not found error [Solved] | bobbyhadz
To solve the error "gulp: command not found", install the gulp-cli package globally by running npm install -g gulp-cli and restart your terminal....
Read more >
Gulp Build Not Working In Visual Studio But ... - Barret Codes
Recently, this build suddenly stopped working and I couldn't figure out why. It ran just fine from the command prompt, but in Task...
Read more >
spfx - All of sudden gulp command not recognizing
Often, it's due to location ref issues (path to the modules when installed globally), so when you run gulp it does not know...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found