jubel-han / serverless-event-body-option

The serverless plugin that provides the extra CLI option for the invoke command to support passing the HTTP body data.
MIT License
0 stars 1 forks source link

Cannot read property 'runtime' of undefined #1

Open a-mroz opened 3 years ago

a-mroz commented 3 years ago

When I use the plugin (v1.2.0) with the latest serverless version (2.16.1) my local lambda invocations fail with:

  TypeError: Cannot read property 'runtime' of undefined
      at AwsInvokeLocal.getRuntime (/home/amroz/personal/link-shortener/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js:56:62)
      at AwsInvokeLocal.invokeLocal (/home/amroz/personal/link-shortener/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js:209:26)
      at Object.invoke:local:invoke [as hook] (/home/amroz/personal/link-shortener/node_modules/serverless/lib/plugins/aws/invokeLocal/index.js:50:41)
      at /home/amroz/personal/link-shortener/node_modules/serverless/lib/classes/PluginManager.js:521:55
  From previous event:
      at PluginManager.invoke (/home/amroz/personal/link-shortener/node_modules/serverless/lib/classes/PluginManager.js:521:22)
      at /home/amroz/personal/link-shortener/node_modules/serverless/lib/classes/PluginManager.js:556:24
  From previous event:
      at PluginManager.run (/home/amroz/personal/link-shortener/node_modules/serverless/lib/classes/PluginManager.js:556:8)
      at /home/amroz/personal/link-shortener/node_modules/serverless/lib/Serverless.js:203:33
      at processImmediate (internal/timers.js:439:21)
      at process.topLevelDomainCallback (domain.js:131:23)
  From previous event:
      at Serverless.run (/home/amroz/personal/link-shortener/node_modules/serverless/lib/Serverless.js:190:74)
      at /home/amroz/personal/link-shortener/node_modules/serverless/scripts/serverless.js:50:26

it happens regardless if I use --body switch or not.

I debugged it a little bit and it turns out that after the plugin is enabled in the serverless.yml file, AwsInvokeLocal.options.functionObj is undefined, while without the plugin it contains properties like name, events, description, handler.

aardvarkk commented 3 years ago

I'm running into the same issue here. It makes the entire plugin unusable from what I can tell?

blakebollinger commented 6 months ago

Is there any update on this? I am still experiencing this issue.