serverless-plugin-bind-deployment-id
serverless-plugin-bind-deployment-id copied to clipboard
Cannot read property 'Properties' of undefined
Hello,
I am getting this error for "sls deploy --stage dev" -
TypeError: Cannot read property 'Properties' of undefined at BindDeploymentId.fixUpDeploymentStage (/et/repo/serverless/channel/node_modules/serverless-plugin-bind-deployment-id/lib/index.js:70:32) at BindDeploymentId.bindDeploymentId (/et/repo/serverless/channel/node_modules/serverless-plugin-bind-deployment-id/lib/index.js:48:35)
My serverless.yml has functions and API Gateway resources and methods.
When I decide to have a trigger for atleast 1 function then this error doesnt appear. But, if none of my lambda functions have a trigger then this errors pops up.
serverless.yml contents are - https://gist.github.com/manjirinamjoshi/ca3900cd814d654e955af9ed069a0b35
Thank you
Sincerely, Manjiri
Hi @manjirinamjoshi thanks for the bug report! The issue here is that Serverless only creates a resource of type AWS::ApiGateway::Deployment when you actually hook up a function to an endpoint. Without that, this plugin doesn't really serve much of a purpose. However, to fix the issue, you could log a warning and return out of bindDeploymentId in src/index if the deploymentId is unset. Happy to approve a PR if you put on up. Thanks again!
Thank you so much for your reply. And, my apologies, I am very new to serverless world. On my local, tried to return out if bindDeploymentId, but ran into this error -
Unresolved resource dependencies [ApiGatewayRestApi] in the Resources block of the template
Any thoughts ?
Thank you
Sincerely, Manjiri
` E:\Work\Satish\serverless\my-app\node_modules\webpack-cli\bin\config-yargs.js:136 describe: optionsSchema.definitions.output.properties.path.description,
^
TypeError: Cannot read property 'properties' of undefined
at module.exports (E:\Work\Satish\serverless\my-app\node_modules\webpack-cli\bin\config-yargs.js:136:48)
at E:\Work\Satish\serverless\my-app\node_modules\webpack-cli\bin\webpack.js:59:27
at Object.ng run my-app:server:serverless && webpack --config webpack.server.config.js --progress --colors
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build:server:serverless script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\SatishPc\AppData\Roaming\npm-cache_logs\2020-02-24T17_26_44_216Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:serverless: npm run build:browser:serverless && npm run build:server:serverless
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build:serverless script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\SatishPc\AppData\Roaming\npm-cache_logs\2020-02-24T17_26_44_264Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:serverless:deploy: npm run build:serverless && npm run deploy
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build:serverless:deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\SatishPc\AppData\Roaming\npm-cache_logs\2020-02-24T17_26_44_308Z-debug.log `
Hi @developersatish thanks for the report - can you give me some more information:
- What version of serverless are you running?
- What version of the plugin are you using?
- What other serverless plugins do you have?
I had the same issue, and it was resolved by adding an event. output from serverless --version Framework Core: 1.79.0 Plugin: 3.7.1 SDK: 2.3.1 Components: 2.34.6
Plugins and versions: "serverless-cloudformation-changesets": "0.0.2", "serverless-dependson-plugin": "^1.1.2", "serverless-deployment-bucket": "^1.1.2", "serverless-plugin-bind-deployment-id": "^1.2.0", "serverless-plugin-create-deployment-bucket": "0.0.2", "serverless-plugin-tracing": "^2.0.0"
This isn't a huge issue, we didn't intend to have a function without any triggers. If we did we would remove this plugin.
I just tried to migrate all of my functions from using http
(API Gateway REST API) to httpApi
(API Gateway HTTP API) and I got this same error. Read more here.
OK. I see that I forgot about the RestAPI Stage and the custom domain name mapping, etc. That's probably what's going on.