0

I have a problem with my gulp code. Every time I try to make a dist file using gulp an error appears. Something with the GulpUglify tool. (I'm still fairly new to using npm so maybe I did something wrong with the installation. If you think that is the case please explain the exact steps I have to take so that it doesn't go wrong again. I have tried to find a solution but none of them helped. I am using es6 in my js code. Here are some of the links I tried.
(if you need any more info please say so!)

How to minify ES6 functions with gulp-uglify? (this one doesnt have the same error as I do but it might have something to do with es6)
https://github.com/terinjokes/gulp-uglify/issues/249 (I tried to do something with this, but I'm new to gulp and I got my file from a friend so I could have a localhost)
https://github.com/terinjokes/gulp-uglify/issues/281 (etc)

Here is what shows up in the console.

throw er; // Unhandled 'error' event
   ^
GulpUglifyError: unable to minify JavaScript
at createError (/Users/rubennijhuis/Desktop/Projects/under-construction/node_modules/gulp-uglify/lib/create-error.js:6:14)
at wrapper (/Users/rubennijhuis/Desktop/Projects/under-construction/node_modules/lodash/_createHybrid.js:87:15)
at trycatch (/Users/rubennijhuis/Desktop/Projects/under-construction/node_modules/gulp-uglify/minifier.js:26:12)
at DestroyableTransform.minify [as _transform] (/Users/rubennijhuis/Desktop/Projects/under-construction/node_modules/gulp-uglify/minifier.js:79:19)
at DestroyableTransform.Transform._read (/Users/rubennijhuis/Desktop/Projects/under-construction/node_modules/readable-stream/lib/_stream_transform.js:182:10)
at DestroyableTransform.Transform._write (/Users/rubennijhuis/Desktop/Projects/under-construction/node_modules/readable-stream/lib/_stream_transform.js:170:83)
at doWrite (/Users/rubennijhuis/Desktop/Projects/under-construction/node_modules/readable-stream/lib/_stream_writable.js:406:64)
at writeOrBuffer (/Users/rubennijhuis/Desktop/Projects/under-construction/node_modules/readable-stream/lib/_stream_writable.js:395:5)
at DestroyableTransform.Writable.write (/Users/rubennijhuis/Desktop/Projects/under-construction/node_modules/readable-stream/lib/_stream_writable.js:322:11)
at Readable.ondata (_stream_readable.js:642:20)
at Readable.emit (events.js:159:13)
at addChunk (_stream_readable.js:265:12)
at readableAddChunk (_stream_readable.js:252:11)
at Readable.push (_stream_readable.js:209:10)
at /Users/rubennijhuis/Desktop/Projects/under-construction/node_modules/fork-stream/index.js:51:13
at classifier (/Users/rubennijhuis/Desktop/Projects/under-construction/node_modules/ternary-stream/index.js:20:11)
  • Did you try using gulp-uglifyes instead of gulp-uglify, as suggested in the second highest rated answer of the related question you linked to? – Patrick Hund Dec 27 '17 at 14:17
  • I sort of fixed the problem by making my js es5 instead of es6. Transpiling is sort of not supported I guess. –  Dec 27 '17 at 21:06

0 Answers0