title: Node Serverless Webpack not working on Lambda
body: <p>I have a situation where my <code>serverless-webpack</code> code works locally (using <code>serverless-offline</code>), but when when I deploy to Lambda, I get a 502.</p>
  
  <p><a href="https://i.stack.imgur.com/lfkpM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lfkpM.png" alt="Hello World screen shot"></a></p>
  
  <p><a href="https://i.stack.imgur.com/sW3J8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sW3J8.png" alt="Internal server error screen shot"></a></p>
  
  <p>It's a fairly simple "Hello World" Node.js application, but I've thrown in some twists as I'm trying to build a starter kit for a "real" app. As with any real JavaScript application, I'd like to code in ES.next (i.e. ES7, Babel, etc) so I'm building with <code>serverless-webpack</code> which supports Babel. I'm using <code>babel-preset-node6</code> (instead of <code>babel-preset-es2015</code> as shown in many examples) and <code>babel-preset-stage-2</code> (but that shouldnt' matter).</p>
  
  <p>I'm also moving the http handler logic (i.e. <code>handler,js</code>) away from the hello world code (i.e. <code>src/helloWorld.js</code>). You know, separation of concerns and all.</p>
  
  <p>Any help would be greatly appreciated!
  The complete code is on <a href="https://github.com/donavon/serverless-hello-world" rel="nofollow noreferrer">Github</a>.</p>
  
  <p>Output from my deploy is:</p>
  
  <pre><code>$ npm run deploy
  
  &gt; serverless-hello-world@1.0.0 deploy /Users/dwest15/Projects/serverless-hello-world
  &gt; serverless deploy --verbose
  
  Serverless: Bundling with Webpack...
  Time: 1668ms
       Asset    Size  Chunks             Chunk Names
  handler.js  3.3 kB       0  [emitted]  main
     [0] ./handler.js 545 bytes {0} [built]
     [1] ./src/helloWorld.js 170 bytes {0} [built]
  Serverless: Packaging service...
  Serverless: Excluding development dependencies...
  Serverless: Uploading CloudFormation file to S3...
  Serverless: Uploading artifacts...
  Serverless: Uploading service .zip file to S3 (1.19 KB)...
  Serverless: Validating template...
  Serverless: Updating Stack...
  Serverless: Checking Stack update progress...
  CloudFormation - UPDATE_IN_PROGRESS - AWS::CloudFormation::Stack - serverless-hello-world-dev
  CloudFormation - UPDATE_IN_PROGRESS - AWS::Lambda::Function - HelloLambdaFunction
  CloudFormation - UPDATE_COMPLETE - AWS::Lambda::Function - HelloLambdaFunction
  CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - HelloLambdaVersionMwMvIa4C7w8VnfGwQ5XC5WckkAFmXlqS8zQstBBMPI
  CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - HelloLambdaVersionMwMvIa4C7w8VnfGwQ5XC5WckkAFmXlqS8zQstBBMPI
  CloudFormation - CREATE_COMPLETE - AWS::Lambda::Version - HelloLambdaVersionMwMvIa4C7w8VnfGwQ5XC5WckkAFmXlqS8zQstBBMPI
  CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Deployment - ApiGatewayDeployment1503159056152
  CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Deployment - ApiGatewayDeployment1503159056152
  CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::Deployment - ApiGatewayDeployment1503159056152
  CloudFormation - UPDATE_COMPLETE_CLEANUP_IN_PROGRESS - AWS::CloudFormation::Stack - serverless-hello-world-dev
  CloudFormation - DELETE_COMPLETE - AWS::Lambda::Version - HelloLambdaVersionhJfJUbfRfskBMTrUXv0UKoa0RHCi3U3mGJ5NcfkxP4
  CloudFormation - DELETE_IN_PROGRESS - AWS::ApiGateway::Deployment - ApiGatewayDeployment1503157776493
  CloudFormation - DELETE_COMPLETE - AWS::ApiGateway::Deployment - ApiGatewayDeployment1503157776493
  CloudFormation - UPDATE_COMPLETE - AWS::CloudFormation::Stack - serverless-hello-world-dev
  Serverless: Stack update finished...
  Service Information
  service: serverless-hello-world
  stage: dev
  region: us-east-1
  stack: serverless-hello-world-dev
  api keys:
    None
  endpoints:
    GET - https://bybx7hbzdh.execute-api.us-east-1.amazonaws.com/dev/hello
  functions:
    hello: serverless-hello-world-dev-hello
  
  Stack Outputs
  HelloLambdaFunctionQualifiedArn: arn:aws:lambda:us-east-1:674804044156:function:serverless-hello-world-dev-hello:7
  ServiceEndpoint: https://bybx7hbzdh.execute-api.us-east-1.amazonaws.com/dev
  ServerlessDeploymentBucketName: serverless-hello-world-d-serverlessdeploymentbuck-nnys203g15q
  
  Serverless: Removing old service versions...
  </code></pre>