Deploy your Hello World API

Link to chapter - https://serverless-stack.com/chapters/deploy-your-first-serverless-api.html

Hello, This chapter states that when the API is deployed it will be in this stage:

stage: prod

Mine is showing this:

stage: dev

Is this a problem?

It isn’t but I think changing it to match the chapter is better.

I’m getting:

An error occurred: HelloLambdaFunction - Uploaded file must be a non-empty zip

The full error:

> serverless deploy
Serverless: DOTENV: Could not find .env file.
Serverless: Deprecation warning: Starting with next major version, default value of provider.lambdaHashingVersion will be equal to "20201221"
            More Info: https://www.serverless.com/framework/docs/deprecations/#LAMBDA_HASHING_VERSION_V2
Serverless: Deprecation warning: Starting with next major version, API Gateway naming will be changed from "{stage}-{service}" to "{service}-{stage}".
            Set "provider.apiGateway.shouldStartNameWithService" to "true" to adapt to the new behavior now.
            More Info: https://www.serverless.com/framework/docs/deprecations/#AWS_API_GATEWAY_NAME_STARTING_WITH_SERVICE
Serverless: Bundling with Webpack...
Serverless: No external modules needed
Serverless: Packaging service...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service hello.zip file to S3 (73.6 KB)...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
...............
Serverless: Operation failed!
Serverless: View the full error output: (redacted)

  Serverless Error ---------------------------------------

  An error occurred: HelloLambdaFunction - Uploaded file must be a non-empty zip (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 42290eb7-24bb-486c-808f-1d194f718752; Proxy: null).

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              15.6.0
     Framework Version:         2.18.0
     Plugin Version:            4.4.2
     SDK Version:               2.3.2
     Components Version:        3.4.6

Any thoughts? My notes-api project seems identical to what’s laid out in the chapter.

Turns out this is a Serverless bug. Using node 15.5 instead of 15.6 worked for me - seems like they’ll have a fix in soon.

1 Like

Glad you figured it out.