Trying to populate non string value into a string for variable
See original GitHub issueThis is a (Bug Report)
Description
- What went wrong? I updated to the latest version of Serverless and I’m now getting an error when I invoke functions locally without adding the stage option in the command line.
- What did you expect should have happened? The function should have been executed without an issue using the default stage as it was set up in the serverless.yml
provider:
name: aws
stage: dev
custom:
stage: ${opt:stage, self:provider.stage}
- What was the config you used?
OS: darwin
Node Version: 6.10.3
Serverless Version: 1.14.0
- What stacktrace or error message from your provider did you see?
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.
Stack Trace --------------------------------------------
ServerlessError: Trying to populate non string value into a string for variable ${opt:stage}. Please make sure the value of the property is a string.
at Variables.populateVariable (/usr/local/lib/node_modules/serverless/lib/classes/Variables.js:143:17)
at singleValueToPopulate.then.valueToPopulate (/usr/local/lib/node_modules/serverless/lib/classes/Variables.js:109:23)
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:9
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Trying to populate non string value into a string for variable
This usually happens when the value is a reference instead of a string, and the reference resolves to a non-string, ie. usually undefined...
Read more >AWS Serverless, CloudFormation : Error, Trying to populate ...
Trying to populate non string value into a string for variable ${self:custom.accountId}. Please make sure the value of the property is a ...
Read more >Error, Trying to populate non string value into a string for ...
I am using serverless framework for deploying my application on AWS Cloud. I want to use the value of AWS Account ID in...
Read more >Serverless error trying to populate non string value into a ...
Serverless error trying to populate non string value into a string for variable. Please make sure the value of the property is a...
Read more >serverless/serverless - Gitter
I get the error : Trying to populate non string value into a string for variable ${file(./config/dev.yml)}. Please make sure the value of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok “fixed” this… the config command I was running doesn’t need a --stage but the way I had set up my yml meant it would complain if it’s not there…
So I added --stage to the config command which fixed things…
I’m new to serverless and just got this same error when trying to login. Is there a fix here or something I need to configure to login and run deployments?