# Limit on including files into serverless.yml

**URL:** <https://forum.serverless.com/t/limit-on-including-files-into-serverless-yml/17327>\
**Category:** Serverless Framework\
**Created:** [June 16, 2022, 8:55am UTC](https://forum.serverless.com/t/limit-on-including-files-into-serverless-yml/17327 "2022-06-16T08:55:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbodnar](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@jbodnar](https://forum.serverless.com/u/jbodnar)\
**Post date:** [June 16, 2022, 8:55am UTC](https://forum.serverless.com/t/limit-on-including-files-into-serverless-yml/17327/1 "2022-06-16T08:55:18Z")

</div>

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
