Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] gulp build command not working #5391

Closed
simoncarbajal opened this issue May 21, 2017 · 41 comments
Closed

[build] gulp build command not working #5391

simoncarbajal opened this issue May 21, 2017 · 41 comments

Comments

@simoncarbajal
Copy link

simoncarbajal commented May 21, 2017

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
@fabulousduck
Copy link

would also like to see this answered as i am having the same issue. ⌛️

@fabulousduck
Copy link

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

@fabulousduck
Copy link

@simoncarbajal i fixed this by completely removing semantic and reinstalling it. not sure where the cause lies. 🤷‍♂️

@tarkwyn
Copy link

tarkwyn commented Jun 22, 2017

Fix is to change filename to fileName in line 96 of semantic/tasks/config/tasks.js

e.g. if(error.fileName.match(/theme.less/)) {

@j-f1
Copy link

j-f1 commented Jun 22, 2017

@tarkwyn Can you make a pull request to fix this?

@SamPlusPlus
Copy link

SamPlusPlus commented Jul 6, 2017

I can confirm that @tarkwynl 's change worked for me. I can provide additional details if needed.

@designosis
Copy link

designosis commented Jul 7, 2017

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

@SamPlusPlus
Copy link

@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.

@designosis
Copy link

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.

@designosis
Copy link

designosis commented Jul 11, 2017

The error persists in 2.2.11 ... unable to successfully gulp build until I removed both preserveComments lines from /semantic/tasks/config/tasks.js.

@jlukic jlukic modified the milestones: 2.2.12, Needs Milestone Jul 11, 2017
@SamPlusPlus
Copy link

@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

@designosis
Copy link

designosis commented Jul 11, 2017

I think I found the problem. This issue ... terinjokes/gulp-uglify#265 ... and the latest gulp-uglify release notes reveal that release v3.0.0 of gulp-uglify REMOVED the custom option preserveComments :)

@vinayakkulkarni
Copy link
Member

vinayakkulkarni commented Jul 12, 2017

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

@rafaelgilead
Copy link

After all, what will be done in the semantic ui ? To remove the option or comment and wait for uglify downgrade ?

@jlukic
Copy link
Member

jlukic commented Jul 15, 2017

I'll fix the dependencies so that we dont use this version of uglify. Sorry about this guys.

@jpetitte
Copy link

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!

@rafaelgilead
Copy link

Commenting out L148 & L162. It worked for me too.

1 similar comment
@bhargavy
Copy link

Commenting out L148 & L162. It worked for me too.

@Madankapoor
Copy link

Commenting out only worked , can't find out if issue is in gulp-uglify or semantic ui.

@jlukic
Copy link
Member

jlukic commented Jul 28, 2017

Will get fix in over weekend. Thanks for patience.

@cur33
Copy link

cur33 commented Jul 31, 2017

Commenting worked for me, too. Glad I wasn't the only one with this problem, since I'm new to semantic ui and gulp--and I'm on a time crunch! Thanks guys!

@sergiomar73
Copy link

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.

@kevinmwangi
Copy link

@sergiomar73 Thanks this fixed it

@basselAhmed
Copy link

@sergiomar73 Thanks man, I can confirm this fixes it.

@cluxter
Copy link

cluxter commented Aug 2, 2017

@sergiomar73 I confirm it too.

@kutalev
Copy link

kutalev commented Aug 3, 2017

@sergiomar73 It worked. Thanks!

@jlukic
Copy link
Member

jlukic commented Aug 6, 2017

A weekend late but pushing this now.

@erdi
Copy link

erdi commented Aug 6, 2017

What's the timeline for releasing 2.2.12, @jlukic?

@cluxter
Copy link

cluxter commented Aug 6, 2017

It's kind of too bad that we have to wait until v2.2.12 is released to see this bug fixed :/
This is a blocking issue for the one who doesn't patch manually and needs to use gulp (sometimes you have to). Wouldn't a v2.2.11.1 be a better solution? Just asking.

@jlukic
Copy link
Member

jlukic commented Aug 6, 2017

@cluxter dont worry, I'm releasing this later tonight. Continuing to jam on issues. Manual fix above should work in interim.

@axper
Copy link

axper commented Aug 7, 2017

Hmm, still getting this error with v2.2.12:

[15:23:13] Plumber found unhandled error:
 GulpUglifyError: unable to minify JavaScript
Caused by: DefaultsError: `comments` is not a supported option
File: /home/axper/project/semantic/dist/components/sticky.js

@zehmigueljr
Copy link

Hi @jlukic , I tried build a test of semantic and the same problem occured. The file tasks.js
already in the new version, with your last commit. I had to apply the solution that @sergiomar73 showed.
I tried build in 2.2.11 and 2.2.12.

jlukic added a commit that referenced this issue Aug 7, 2017
@jlukic
Copy link
Member

jlukic commented Aug 7, 2017

Patch incoming

@jlukic
Copy link
Member

jlukic commented Aug 7, 2017

And out 2.2.13

@zehmigueljr
Copy link

Hi, @jlukic
I have installed de last updates (2.2.13) of semantic and tried build the project.
The fix worked succefully.

Thanks a lot.

@jlukic
Copy link
Member

jlukic commented Aug 7, 2017

Sorry about mistakes with the first fix.

@cluxter
Copy link

cluxter commented Aug 8, 2017

v2.2.13 works on my side. Thanks a lot @jlukic !

erdi added a commit to apache/groovy-geb that referenced this issue Oct 5, 2017
@flornet
Copy link

flornet commented Nov 15, 2017

Hi, I've been having the exact same issue with 2.2.13.
To solve it, I've had to update Node.js & NPM.
It might be obvious... but it wasn't for me :)

@dickmao
Copy link

dickmao commented Nov 22, 2017

Yes, can confirm that default version of nodejs 4.2.6 for ubuntu 16.04 won't work. Needed to upgrade to 6.x.x. Thanks.

@peppelinux
Copy link

peppelinux commented Apr 9, 2018

Confirmed that it's a problem related to nodejs version. Fixed with:

export NODE_VERSION="node-v8.11.1-linux-x64"
cd /opt
# LTS version
wget https://nodejs.org/dist/v8.11.1/$NODE_VERSION.tar.xz
# decompress it
tar xvf $NODE_VERSION.tar.xz

# put it in the executables defaults environment path
export PATH=$PATH:/opt/$NODE_VERSION/bin:$PWD/node_modules/bower/bin

then use node.js as usual.
Remember also to uninstall previous node.js installations

@harshsingh206
Copy link

Plumber found unhandled error:
GulpUglifyError: unable to minify JavaScript
Caused by: SyntaxError: Unexpected token: punc ())

Any idea on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests