You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mavax, you're largely correct. This plugin fails if you don't provide the optional command line
argument 'stage'. That seems like bug territory. Though, ergh, this is such a painful topic. Mostly because the serverless team have been so painfully unopinionated about it. Their docs sometimes say to use
provider:
stage: ${opt:stage, 'dev'}
but sometimes say to make a custom variable the single point of truth, and worse still in their default template they don't broach the issue at all. Thus I can see that pointing to provider.stage as not an appropriate solution for all.
Perhaps a more universal solution to this bug would be to employ the same logic in the code? i.e., look for opt.stage, and if not there, look for provider.stage. I imagine this is what other plugins do.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was having issues when I had serverless variables specified including stage, those were not being used.
Also, the error was not very clear:
I'm not 100% sure this is the proper way to do this, but it seems to work for my case.