Error while invoking Billing API
See original GitHub issueBug Report
Description
- What did you do? Invoke Billing API for testing
- What happened? TypeError [ERR_INVALID_ARG_TYPE]: The “to” argument must be of type string. Received type undefined
- What should’ve happened? Normal response without error
- What’s the content of your
serverless.yml
file? billing:Defines an HTTP API endpoint that calls the main function in billing.js
- path: url path is /billing
- method: POST request
handler: billing.main events:- http: path: billing method: post cors: true authorizer: aws_iam
- What’s the output you get when you use the
SLS_DEBUG=*
environment variable (e.g.SLS_DEBUG=* serverless deploy
)
at validateString (internal/validators.js:112:11) at Object.relative (path.js:438:5) at C:\Users\asnai\notes-app-api\node_modules\serverless-webpack\lib\validate.js:182:38 at arrayMap (C:\Users\asnai\notes-app-api\node_modules\lodash\lodash.js:639:23) at Function.map (C:\Users\asnai\notes-app-api\node_modules\lodash\lodash.js:9554:14) at processConfig (C:\Users\asnai\notes-app-api\node_modules\serverless-webpack\lib\validate.js:177:37) at ServerlessPlugin.validate (C:\Users\asnai\notes-app-api\node_modules\serverless-webpack\lib\validate.js:229:14) at ServerlessPlugin.tryCatcher (C:\Users\asnai\notes-app-api\node_modules\bluebird\js\release\util.js:16:23) at Promise._settlePromiseFromHandler (C:\Users\asnai\notes-app-api\node_modules\bluebird\js\release\promise.js:547:31) at Promise._settlePromise (C:\Users\asnai\notes-app-api\node_modules\bluebird\js\release\promise.js:604:18) at Promise._settlePromiseCtx (C:\Users\asnai\notes-app-api\node_modules\bluebird\js\release\promise.js:641:10) at _drainQueueStep (C:\Users\asnai\notes-app-api\node_modules\bluebird\js\release\async.js:97:12) at _drainQueue (C:\Users\asnai\notes-app-api\node_modules\bluebird\js\release\async.js:86:9) at Async._drainQueues (C:\Users\asnai\notes-app-api\node_modules\bluebird\js\release\async.js:102:5) at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\asnai\notes-app-api\node_modules\bluebird\js\release\async.js:15:14) at processImmediate (internal/timers.js:439:21) at process.topLevelDomainCallback (domain.js:131:23)
Similar or dependent issues: None
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
The environment block in your serverless.yml is duplicated. Delete one and that should solve the problem. The remaining block should look like this:
Worked for me too. I had to correct my indentation