0

Got the below issue after the chalk version updated from 2.4.2 to 3.0.0. The gulp build fails resulting in production build failure.

--- frontend-maven-plugin:1.0:gulp (gulp build) @ vcedpa ---
[INFO] Running 'gulp.js build' in /auto/builds/idpa/main/640037/vcedpa-war/../ui
[ERROR] /auto/builds/idpa/main/640037/ui/node_modules/run-sequence/node_modules/chalk/source/index.js:3
[ERROR] const {stdout: stdoutColor, stderr: stderrColor} = require('supports-color');
[ERROR] ^
[ERROR]
[ERROR] SyntaxError: Unexpected token {
[ERROR] at exports.runInThisContext (vm.js:53:16)
[ERROR] at Module._compile (module.js:373:25)
[ERROR] at Object.Module._extensions..js (module.js:416:10)
[ERROR] at Module.load (module.js:343:32)
[ERROR] at Function.Module._load (module.js:300:12)
[ERROR] at Module.require (module.js:353:17)
[ERROR] at require (internal/module.js:12:17)
[ERROR] at Object. (/auto/builds/idpa/main/640037/ui/node_modules/run-sequence/index.js:5:14)
[ERROR] at Module._compile (module.js:409:26)
[ERROR] at Object.Module._extensions..js (module.js:416:10)

Immediate answer will be much appreciated.
Newms
  • 124
  • 1
  • 6
richa jha
  • 13
  • 1
  • 2

2 Answers2

1

I got the seem issue, downgrading back to 2.4.2 solves the problem

luke yi
  • 34
  • 1
0

Could you possibly post your gulpfile.js? As Gulp itself is just a task runner, your gulpfile.js might help us determine where it's failing.

Just looking at the error itself, it seems that gulp here may be having an issue with object destructuring (which the source code of chalk.js version 2.4.2 does not seem to use). I personally have had some recent issues with gulp-babel and/or gulp-uglify not working correctly and basically complaining about modern JavaScript features, and have had to replace gulp-uglify with terser.

My guess would be that whatever minification/uglification library you're using has not been updated, and thus doesn't "get" object destructuring.

Newms
  • 124
  • 1
  • 6