Serverless Invalid Variable Reference Syntax for Variable ([\S\S]+?)

I am getting the following error when doing a serverless deploy

Invalid variable reference syntax for variable ([\s\S]+?). You can only reference env vars, options, & files. You can check our docs for more info.

I think it is caused by the following line in my serverless.yml (in the environment block of the provider block):

variableSyntax: "\\${{([\\s\\S]+?)}}"

Why is this invalid? Or is the error actually elsewhere, and if it is, how can I see what line in what file is causing the error?

3
David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article