Hardcoded fallback variables dont work in 1.36.0

I just updated to 1.36.0 and now and when I launch serverless offline without a stage I get an error:

sls offline start
 
  Serverless Error ---------------------------------------
 
  Serverless plugin "/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js" initialization errored: Invalid stage name ${opt:stage, local}: it should contains only [a-zA-Z0-9] for AWS provider if http event are present since API Gateway stage name cannot contains hyphens.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           8.10.0
     Serverless Version:     1.36.0

In serverless.yml I have:

provider:
    name: aws
    runtime: nodejs8.10
    stage: ${opt:stage, 'local'}

This used to work just fine, and infact, its still in the example documentation:

    provider:
    name: aws
    stage: ${opt:stage, 'dev'}

it does work if I specify the stage at the commandline:
sls offline start --stage=local

Bug? or change?

4 Likes

We’re facing the exact same issue, we’ve downgraded to 1.35.1 for the time being. Shall wait for a fix or a notice that this has been a breaking change requiring further config.

Same issue for me. Hope soon the fix will be released.

I had to fall back to npm i -g serverless@1.35.1 this fix the issue for now