Skip to content

Cannot resolve variable at "provider.stage": Value not found at "env" source #12247

Closed Answered by 0xk0nf
0xazuki7 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @melvindraaijer
I believe this section is problematic in your case

custom:
  dotenv:
    basePath: ./
    stage: ${env:STAGE}
    region: ${env:REGION}

serverless-dotenv-plugin loads different .env files based on the stage (e.g. passed via --env arg) but this tries to access STAGE from environment. Short "fix" might be to declare stage explicitly as an env var when invoking command .e.g STAGE=uat sls deploy --env uat in your case.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@0xazuki7
Comment options

Answer selected by 0xazuki7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants