Skip to content

Default variable value not being honored #6014

Closed

Description

@billy-bacon

This is a Bug Report

Description

  • What went wrong?
    Default variable value not being honored. Throws an error if I run sls deploy without a stage.

  • What did you expect should have happened?
    Running sls deploy without --stage option should have set stage to 'development'

  • What was the config you used?

provider:
  name: aws
  profile: default
  runtime: nodejs8.10
  stage: ${opt:stage, 'development'}
  • What stacktrace or error message from your provider did you see?

Trying to populate non string value into a string for variable ${opt:stage}. Please make sure the value of the property is a string.
Similar or dependent issues:

Additional Data

  • Serverless Framework Version you're using: 1.40.0
  • Operating System: OSX 10.14.4
  • Stack Trace:
  • Provider Error messages:
    bbacon@venus (feature/936140__f__create_expired_reserved_holds_lambda *+) ~/dev/clients/dillon/hoopla/hoopla-holds-processing: sls deploy

Serverless Warning --------------------------------------

A valid option to satisfy the declaration 'opt:stage' could not be found.

Serverless Warning --------------------------------------

A valid option to satisfy the declaration 'opt:stage' could not be found.

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

Trying to populate non string value into a string for variable ${opt:stage}. Please make sure the value of the property is a string.

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

Your Environment Information ---------------------------
OS: darwin
Node Version: 8.11.1
Serverless Version: 1.40.0

Activity

  1. jbsulli commented on Mar 13, 2020

    @jbsulli

    I found that --stage overwrites whatever you have in provider.stage anyway. So I would just change this to:

    provider:
      name: aws
      profile: default
      runtime: nodejs8.10
      stage: development
    
  2. pmyjavec commented on Mar 31, 2020

    @pmyjavec

    @jbsulli that's fine, until you want to re-use a provider configuration with multiple stages.

  3. medikoo commented on Mar 3, 2021

    @medikoo
    Contributor

    Fixed with #8987

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions