serverless-SAM-typescript-boilerplate icon indicating copy to clipboard operation
serverless-SAM-typescript-boilerplate copied to clipboard

Update webpack.config.ts so that npm run build:prod works

Open JustDerb opened this issue 4 years ago • 1 comments

Without this change, the template throws a build error:

const entries = Object.values(resources)
                       ^
TypeError: Cannot convert undefined or null to object

this is because the variable extraction from the yamlParse call is case-sensitive. Actual output of yamlParse:

{
  AWSTemplateFormatVersion: '2010-09-09',
  Transform: 'AWS::Serverless-2016-10-31',
  Description: 'hellword-api',
  Globals: { Function: { Timeout: 60 } },
  Resources: {
    GlobalDependenciesLayer: {
      Type: 'AWS::Serverless::LayerVersion',
      Properties: [Object],
      Metadata: [Object]
    },
    GlobalApiResponsesLayer: {
      Type: 'AWS::Serverless::LayerVersion',
      Properties: [Object],
      Metadata: [Object]
    },
    GreetingFunction: { Type: 'AWS::Serverless::Function', Properties: [Object] }
  }
}

JustDerb avatar Dec 16 '20 21:12 JustDerb

Ah, I see https://github.com/Borduhh/serverless-SAM-typescript-boilerplate/pull/1 has already addressed this!

JustDerb avatar Dec 16 '20 21:12 JustDerb