You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/var/www/project-name/node_modules/@cedx/gulp-php-minify/lib/fast_transformer.js:35
async close() {
^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/var/www/project-name/node_modules/@cedx/gulp-php-minify/lib/index.js:7:25)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
The text was updated successfully, but these errors were encountered:
@rivajunior , I had this same problem. It's because of the 'async' keyword which is a new feature in ES7.
I fixed the problem updating my node.js to version 8.
They say it works on version 7, but I didn't tested.
@agbottan found the issue : I'm using async/await functions in this package. These ES2017 features require a Node.js 7.6+ runtime.
@rivajunior, you must either upgrade your Node.js runtime, or downgrade the gulp-php-minify version to 1.1.0 (the last one working with a pre-7.6 runtime). But beware : there was some issues with old versions. You should really consider to upgrade your Node.js runtime (v8 will be the next LTS in a few months).
I am for the first time trying to minify my php code for increase my score in pagespeed by Google.
But I find that error when I require the plugin gulp-php-minify. You can see in code below.
const {phpMinify} = require('@cedx/gulp-php-minify');
I did the same as the example on the plugin page.
The text was updated successfully, but these errors were encountered: