I am using serverless framework and build is failing with following error

Environment: linux, node 12.22.12, framework 3.30.1, plugin 6.2.3, SDK 4.3.2

Error:
Cannot resolve serverless.yml: Variables resolution errored with:

  • Cannot resolve variable at “custom.stage”: Value not found at “self” source

image
look at the image I share, if you talk about custom.stage you are saying that in your serverless.yml file you have created a custom section and inside it you have a parameter called stage that you fill with some information; in the image you see that the variable was created and is entered as an option in case the information does not arrive from the CLI, finally, the stage parameter is called from self:provider.stage

Thank you for providing the details.

The above error started coming when I upgraded from “npm install -g serverless@1.77.1” → npm install -g serverless (latest-3)

But Initially the following error was throwing:
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
SyntaxError: Unexpected token ‘?’

Our Environment Information ---------------------------
Operating System: linux
Node Version: 12.18.3
Framework Version: 1.77.1
Plugin Version: 3.6.18
SDK Version: 2.3.1
Components Version: 2.33.0