-
Notifications
You must be signed in to change notification settings - Fork 157
Closed
nodeshift/faas-js-runtime
#71Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.templates/nodeRelated to the Node.js function templatesRelated to the Node.js function templates
Description
Describe the bug
Created a nodejs function, ran it locally, and curling the loclhost:8080 endpoint produces an error.
To Reproduce
Steps to reproduce the behavior:
kn faas init -l node
npm run local
curl -X POST -d '{"hello": "world"}' -H'Content-type: application/json' -H'Ce-id: 1' -H'Ce-source: cloud-event-example' -H'Ce-type: dev.knative.example' -H'Ce-specversion: 1.0' http://localhost:8080
Result: {"statusMessage":"Cannot read property 'info' of undefined"}
TypeError: Cannot read property 'info' of undefined
at invoke (/home/afield/Development/go/bin/func1/index.js:30:15)
at invokeFunction (/home/afield/.npm/_npx/1178569/lib/node_modules/faas-js-runtime/lib/invoker.js:21:34)
at Object.doPost (/home/afield/.npm/_npx/1178569/lib/node_modules/faas-js-runtime/lib/request-handler.js:18:28)
at preHandlerCallback (/home/afield/.npm/_npx/1178569/lib/node_modules/faas-js-runtime/node_modules/fastify/lib/handleRequest.js:124:28)
at next (/home/afield/.npm/_npx/1178569/lib/node_modules/faas-js-runtime/node_modules/fastify/lib/hooks.js:158:7)
at Object.<anonymous> (/home/afield/.npm/_npx/1178569/lib/node_modules/faas-js-runtime/lib/event-handler.js:26:5)
at hookIterator (/home/afield/.npm/_npx/1178569/lib/node_modules/faas-js-runtime/node_modules/fastify/lib/hooks.js:221:10)
at next (/home/afield/.npm/_npx/1178569/lib/node_modules/faas-js-runtime/node_modules/fastify/lib/hooks.js:162:20)
at Object.<anonymous> (/home/afield/.npm/_npx/1178569/lib/node_modules/faas-js-runtime/index.js:32:5)
at hookIterator (/home/afield/.npm/_npx/1178569/lib/node_modules/faas-js-runtime/node_modules/fastify/lib/hooks.js:221:10)
Expected behavior
The CloudEvent is delivered to the function without error.
Metadata
Metadata
Assignees
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.templates/nodeRelated to the Node.js function templatesRelated to the Node.js function templates