serverless-step-functions
serverless-step-functions copied to clipboard
Receiving TypeError: Cannot read property 'stepFunctions' of undefined since 3.0.0 release
This is a Bug Report
Description
For bug reports:
- What went wrong?
Since the v3.0.0 release my team is unable to deploy stacks that include the stepFunctions section in theserverless.yamlfile, seeingTypeError: Cannot read property 'stepFunctions' of undefinedat least when trying to deploy a new stack that includes astepFunctionssection. Pinning toserverless-step-functions v2.32.0resolves the issue. - What did you expect should have happened?
Expected this to work as usual and stack to be deployed w/o issue. The sameserverless.yamlfiles have been working for creating/updating new/existing stacks for years, no changes were made to these files on our end. - What was the config you used?
Pertinent section of myserverless.yamlfile:
stepFunctions:
stateMachines:
partnerStateMachine:
name: dxdl_sm-partner_state_machine_${self:provider.stage}
role: ${file(../../config/env_configs.yaml):${self:provider.stage}.role}
definition: ${file(../../step_functions/partners/create_partner_sfn.yml):definition}
deletePartnerStateMachine:
name: dxdl_sm-delete_partner_state_machine_${self:provider.stage}
role: ${file(../../config/env_configs.yaml):${self:provider.stage}.role}
definition: ${file(../../step_functions/partners/delete_partner_sfn.yml):definition}
- What stacktrace or error message from your provider did you see?
709 | Type Error ---------------------------------------------
--
710 |
711 | Cannot read property 'stepFunctions' of undefined
712 |
713 | For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
714 |
715 | Get Support --------------------------------------------
716 | Docs: docs.serverless.com
717 | Bugs: github.com/serverless/serverless/issues
718 | Issues: forum.serverless.com
719 |
720 | Your Environment Information ---------------------------
721 | Operating System: linux
722 | Node Version: 10.1.0
723 | Serverless Version: 1.48.3
724 | Enterprise Plugin Version: 1.3.11
725 | Platform SDK Version: 2.3.2
Similar or dependent issues:
- NA AFAIK
Additional Data
- Serverless Framework Core Version you're using: 1.48.3
- The Plugin Version you're using: 3.0.0
- Operating System: linux
- Stack Trace:
709 | Type Error ---------------------------------------------
--
710 |
711 | Cannot read property 'stepFunctions' of undefined
712 |
713 | For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
714 |
715 | Get Support --------------------------------------------
716 | Docs: docs.serverless.com
717 | Bugs: github.com/serverless/serverless/issues
718 | Issues: forum.serverless.com
719 |
720 | Your Environment Information ---------------------------
721 | Operating System: linux
722 | Node Version: 10.1.0
723 | Serverless Version: 1.48.3
724 | Enterprise Plugin Version: 1.3.11
725 | Platform SDK Version: 2.3.2
- Provider Error messages:
TypeError: Cannot read property 'stepFunctions' of undefined
same issue
take a look what i find at serverless forum link
Thanks for the additional link @Fomin2402 to confirm I do have serverless-step-functions called out in the plugins section of my serverless.yaml file:
plugins:
- serverless-step-functions
- serverless-pseudo-parameters
Same issue with v3.0.0. Only it works with v2.32.0
Same issue `Type Error ---------------------------------------------
TypeError: Cannot read property 'stepFunctions' of undefined at ServerlessStepFunctions.yamlParse (/home/Desktop/serverless-backend/node_modules/serverless-step-functions/lib/yamlParser.js:10:30) at ServerlessStepFunctions.tryCatcher (/home/Desktop/serverless-backend/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/home/Desktop/serverless-backend/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/home/Desktop/serverless-backend/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromiseCtx (/home/Desktop/serverless-backend/node_modules/bluebird/js/release/promise.js:641:10) at _drainQueueStep (/home/Desktop/serverless-backend/node_modules/bluebird/js/release/async.js:97:12) at _drainQueue (/home/Desktop/serverless-backend/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/home/Desktop/serverless-backend/node_modules/bluebird/js/release/async.js:102:5) at Immediate.Async.drainQueues [as _onImmediate] (/home/Desktop/serverless-backend/node_modules/bluebird/js/release/async.js:15:14) at processImmediate (internal/timers.js:464:21)
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Get Support -------------------------------------------- Docs: docs.serverless.com Bugs: github.com/serverless/serverless/issues Issues: forum.serverless.com
Your Environment Information --------------------------- Operating System: linux Node Version: 14.17.6 Framework Version: 2.0.0 Plugin Version: 4.0.2 SDK Version: 2.3.2 Components Version: 3.1.2`
Getting the same issue on 3.1.0. I've used 2.21.1 on previous APIs fine, but integrating step functions into a different API using the latest version doesn't seem to work.
TypeError: Cannot read property 'stepFunctions' of undefined at ServerlessStepFunctions.yamlParse (node_modules\serverless-step-functions\lib\yamlParser.js:10:30) at ServerlessStepFunctions.tryCatcher (node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (node_modules\bluebird\js\release\promise.js:547:31) at Promise._settlePromise (node_modules\bluebird\js\release\promise.js:604:18) at Promise._settlePromiseCtx (node_modules\bluebird\js\release\promise.js:641:10) at _drainQueueStep (node_modules\bluebird\js\release\async.js:97:12) at _drainQueue (node_modules\bluebird\js\release\async.js:86:9) at Async._drainQueues (node_modules\bluebird\js\release\async.js:102:5) at Immediate.Async.drainQueues [node_modules\bluebird\js\release\async.js:15:14) at processImmediate (internal/timers.js:439:21) at process.topLevelDomainCallback (domain.js:130:23)
Your Environment Information --------------------------- Operating System: win32 Node Version: 12.13.1 Framework Version: 1.62.0 SDK Version: 2.3.0 Components Core Version: 1.1.2 Components CLI Version: 1.4.0
Any resolution to this issue ?
I faced the same issue. I was running an incompatible plugin version with my serverless framework. I fixed it by downgrading the stepfunctions plugin version to "^1.20.0"
"serverless-step-functions": "^1.20.0"
Hi,
Someone manages to trigger a step functions workflow from a lambda ? I do not.
{
"errorType": "TypeError",
"errorMessage": "Cannot read properties of undefined (reading 'StepFunctions')",
"stack": [
"TypeError: Cannot read properties of undefined (reading 'StepFunctions')",
" at /var/task/handler.js:47:55",
" at step (/var/task/handler.js:33:23)",
" at Object.next (/var/task/handler.js:14:53)",
" at /var/task/handler.js:8:71",
" at new Promise (<anonymous>)",
" at __awaiter (/var/task/handler.js:4:12)",
" at Runtime.essaiworkflow [as handler] (/var/task/handler.js:41:47)",
" at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1083:29)"
]
}