Limit on including files into serverless.yml

Hi all,

I try to break down one large serverless.yml file into smaller manageable ones and include them with $file(PATH_TO_FILE)
serverless.yml includes a number of

  • environment setting files
  • templates per functions
  • model documentation parts

all together we have 48 files included and works fine.
however when I add one more file I get the error message bellow , regardless I
include a documentation or a template file.
The same include that breaks the service works perfectly fine if I remove any others , reducing the number of files .
Did anybody face similar problem? Could be a kind of limitation on size or number of files ?

TypeError: Cannot read property ‘shift’ of undefined
at VariablesResolver.resolveVariable (/usr/lib/node_modules/serverless/lib/configuration/variables/resolve.js:230:28)
at async /usr/lib/node_modules/serverless/lib/configuration/variables/resolve.js:118:9
at async Promise.all (index 0)
at async VariablesResolver.resolveVariables (/usr/lib/node_modules/serverless/lib/configuration/variables/resolve.js:112:5)
at async VariablesResolver.self (/usr/lib/node_modules/serverless/lib/configuration/variables/resolve.js:454:9)

  • with gitlab-runner 15.0.0
  • node14
  • serverless -v
    Framework Core: 2.72.3
    Plugin: 5.5.4
    SDK: 4.3.2
    Components: 3.18.2