serverless-optimizer-plugin icon indicating copy to clipboard operation
serverless-optimizer-plugin copied to clipboard

Optimizer crashes on ES2015-compliant code.

Open cdichiara opened this issue 8 years ago • 7 comments

So, getting this error:

JS_Parse_Error {
  message: 'Unexpected token: name (tempPass)',
  filename: 'C:\\Users\\...\\_meta\\_tmp\\clientApi@1461203961098\\optimized\\clientApi\\_serverless_handler.js',

The code is:

  let tempPass = request.password;

A similar issue with:

  var cognitoParams = {
    IdentityPoolId: process.env.cognitoIdentityPool,
    Logins: {
      [process.env.cognitoDeveloperName]: cognitoKey
    }
  };

Result is:

Serverless: ------------------------
Serverless: Failed to deploy the following functions in "carmine" to the following regions:
Serverless: us-east-1 ------------------------
Serverless:   clientApi: Unexpected token: name (process)
C:\Users\...\npm\node_modules\serverless\node_modules\bluebird\js\release\async.js:61
        fn = function () { throw arg; };

This is serverless-optimizer-plugin v2.5.1. Code is running fine on Lambda when I remove the optimizer plugin.

cdichiara avatar Apr 21 '16 02:04 cdichiara