Skip to content

Optimizer crashes on ES2015-compliant code. #44

@cdichiara

Description

@cdichiara

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions