I know the Jenkins that I am running my code there, is using an old version on Node.js, but I don't have any permission to update it. Unfortunately updating Node.js is not a choice for me. I have done all the suggestion on github, stackoverflow, etc. but my code is still failing in Jenkins build. here is what I have added to the first lines of webpack.production.config.js:
require('es6-promise').polyfill();
require('es6-promise/auto');
var Promise = require('promise');
and here the added modules into package.json:
"devDependencies": {
...
"es6-promise": "^4.0.5",
"promise" : "^7.1.1"
}
but I am still getting the following error in jenkins build:
14:33:20 ERROR in ./~/css-loader!./~/less-loader!./style/cwa/global.less
14:33:20 Module build failed: ReferenceError: Promise is not defined
14:33:20 at LazyResult.async (/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:225:31)
14:33:20 at LazyResult.then (/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:131:21)
14:33:20 at processCss (/node_modules/css-loader/lib/processCss.js:199:5)
14:33:20 at Object.module.exports (/node_modules/css-loader/lib/loader.js:24:2)
14:33:20 @ ./style/cwa/global.less 4:14-123
14:33:20 ERROR in ./~/css-loader!./~/less-loader!./style/cwa/autosuggest.less
14:33:20 Module build failed: ReferenceError: Promise is not defined
14:33:20 at LazyResult.async (/node_modules/postcss/lib/lazy-result.js:225:31)
14:33:20 at LazyResult.then (/node_modules/css-loader/node_modules/postcss/lib/lazy-result.js:131:21)
14:33:20 at processCss (/node_modules/css-loader/lib/processCss.js:199:5)
14:33:20 at Object.module.exports (/node_modules/css-loader/lib/loader.js:24:2)
14:33:20 @ ./style/cwa/autosuggest.less 4:14-128
I really dont know what to do at this stage. if anybody knows, please help.