# Cannot deploy lambda functions

**URL:** <https://discourse.sst.dev/t/cannot-deploy-lambda-functions/2412>\
**Category:** Chapter Comments\
**Created:** [June 16, 2021, 1:08pm UTC](https://discourse.sst.dev/t/cannot-deploy-lambda-functions/2412 "2021-06-16T13:08:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tobamaestro](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/tobamaestro/32/1179_2.png) [@tobamaestro](https://discourse.sst.dev/u/tobamaestro)\
**Post date:** [June 16, 2021, 1:08pm UTC](https://discourse.sst.dev/t/cannot-deploy-lambda-functions/2412/1 "2021-06-16T13:08:54Z")

</div>

Hi, I finished adding notes APIs and I cannot deploy any of the functions. I’m have installed following versions:

node 16.3.0  
awscli 2.2.12  
aws-iam-authenticator 0.5.3

These dependencies in package.json:

“devDependencies”: {  
“aws-sdk”: “^2.927.0”,  
“serverless-bundle”: “^1.4.0”,  
“serverless-dotenv-plugin”: “^2.1.1”,  
“serverless-offline”: “^5.3.3”  
},  
“dependencies”: {  
“uuid”: “^7.0.3”  
}

This is the error I’m getting when I run serverless deploy command::

Type Error ----------------------------------------------

TypeError: Found non-callable @@iterator  
at AwsPackage.mergeStatements (/usr/local/lib/node\_modules/serverless/lib/plugins/aws/package/lib/mergeIamTemplates.js:231:55)  
at AwsPackage.mergeIamTemplates (/usr/local/lib/node\_modules/serverless/lib/plugins/aws/package/lib/mergeIamTemplates.js:180:12)  
at Object.package:setupProviderConfiguration [as hook] (/usr/local/lib/node\_modules/serverless/lib/plugins/aws/package/index.js:69:56)  
at PluginManager.invoke (/usr/local/lib/node\_modules/serverless/lib/classes/PluginManager.js:576:20)  
at async PluginManager.spawn (/usr/local/lib/node\_modules/serverless/lib/classes/PluginManager.js:598:5)  
at async Object.before:deploy:deploy [as hook] (/usr/local/lib/node\_modules/serverless/lib/plugins/deploy.js:49:11)  
at async PluginManager.invoke (/usr/local/lib/node\_modules/serverless/lib/classes/PluginManager.js:576:9)  
at async PluginManager.run (/usr/local/lib/node\_modules/serverless/lib/classes/PluginManager.js:634:7)  
at async Serverless.run (/usr/local/lib/node\_modules/serverless/lib/Serverless.js:431:5)  
at async /usr/local/lib/node\_modules/serverless/scripts/serverless.js:685:9

And here is the full output of the command with SLS\_DEBUG=\* option in the .env file:

Serverless: Deprecation warning: Detected “.env” files. In the next major release variables from “.env” files will be automatically loaded into the serverless build process. Set “useDotenv: true” to adopt that behavior now.  
More Info:  
Serverless: DOTENV: Loading environment variables from .env:  
Serverless: - SLS\_DEBUG  
Serverless: Load command login  
Serverless: Load command logout  
Serverless: Load command generate-event  
Serverless: Load command test  
Serverless: Load command dashboard  
Serverless: Load command output  
Serverless: Load command output:get  
Serverless: Load command output:list  
Serverless: Load command param  
Serverless: Load command param:get  
Serverless: Load command param:list  
Serverless: Load command studio  
(node:5780) [DEP0148] DeprecationWarning: Use of deprecated folder mapping “./” in the “exports” field module resolution of the package at /Users/tobamaestro/Workspace/practice/serverless/notes-api/node\_modules/es-abstract/package.json.  
Update this package.json to use a subpath pattern like “./\*”.  
(Use `node --trace-deprecation ...` to show where the warning was created)  
Serverless: Deprecation warning: CLI options definitions were upgraded with “type” property (which could be one of “string”, “boolean”, “multiple”). Below listed plugins do not predefine type for introduced options:  
- ServerlessPlugin for “out”  
- ServerlessOffline for “apiKey”, “binPath”, “cacheInvalidationRegex”, “corsAllowHeaders”, “corsAllowOrigin”, “corsDisallowCredentials”, “corsExposedHeaders”, “disableCookieValidation”, “enforceSecureCookies”, “exec”, “hideStackTraces”, “host”, “httpsProtocol”, “location”, “noAuth”, “noEnvironment”, “port”, “prefix”, “preserveTrailingSlash”, “printOutput”, “providedRuntime”, “region”, “resourceRoutes”, “showDuration”, “skipCacheInvalidation”, “stage”, “useSeparateProcesses”, “websocketPort”  
Please report this issue in plugin issue tracker.  
Starting with next major release, this will be communicated with a thrown error.  
Serverless: Skipping variables resolution with old resolver (new resolver reported no more variables to resolve)  
Serverless: Configuration warning at ‘provider.iamRoleStatements’: should be array  
Serverless:  
Serverless:  
Serverless: Deprecation warning: Starting with next major, Serverless will throw on configuration errors by default. Adapt to this behavior now by adding “configValidationMode: error” to service configuration  
Serverless: Deprecation warning: Starting with version 3.0.0, following property will be replaced:  
“provider.iamRoleStatements” → “provider.iam.role.statements”  
Serverless: Deprecation warning: Resolution of lambda version hashes was improved with better algorithm, which will be used in next major release.  
Switch to it now by setting “provider.lambdaHashingVersion” to “20201221”  
Serverless: Invoke deploy  
Serverless: Invoke package  
Serverless: Invoke aws:common:validate  
Serverless: Invoke aws:common:cleanupTempDir

Type Error ----------------------------------------------

TypeError: Found non-callable @@iterator  
at AwsPackage.mergeStatements (/usr/local/lib/node\_modules/serverless/lib/plugins/aws/package/lib/mergeIamTemplates.js:231:55)  
at AwsPackage.mergeIamTemplates (/usr/local/lib/node\_modules/serverless/lib/plugins/aws/package/lib/mergeIamTemplates.js:180:12)  
at Object.package:setupProviderConfiguration [as hook] (/usr/local/lib/node\_modules/serverless/lib/plugins/aws/package/index.js:69:56)  
at PluginManager.invoke (/usr/local/lib/node\_modules/serverless/lib/classes/PluginManager.js:576:20)  
at async PluginManager.spawn (/usr/local/lib/node\_modules/serverless/lib/classes/PluginManager.js:598:5)  
at async Object.before:deploy:deploy [as hook] (/usr/local/lib/node\_modules/serverless/lib/plugins/deploy.js:49:11)  
at async PluginManager.invoke (/usr/local/lib/node\_modules/serverless/lib/classes/PluginManager.js:576:9)  
at async PluginManager.run (/usr/local/lib/node\_modules/serverless/lib/classes/PluginManager.js:634:7)  
at async Serverless.run (/usr/local/lib/node\_modules/serverless/lib/Serverless.js:431:5)  
at async /usr/local/lib/node\_modules/serverless/scripts/serverless.js:685:9

Your Environment Information ---------------------------  
Operating System: darwin  
Node Version: 16.3.0  
Framework Version: 2.46.0  
Plugin Version: 5.3.0  
SDK Version: 4.2.3  
Components Version: 3.12.0

---

<div class="post-metadata">

**Author:** ![tobamaestro](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/tobamaestro/32/1179_2.png) [@tobamaestro](https://discourse.sst.dev/u/tobamaestro)\
**Post date:** [June 24, 2021, 12:39pm UTC](https://discourse.sst.dev/t/cannot-deploy-lambda-functions/2412/2 "2021-06-24T12:39:33Z")

</div>

Wow, I fixed it. I started solving deprecation messages and just switched imaRoleStatements to iam.role.statements and it worked. I also added useDotenv: true, but don’t think that has to do anything with this.
