"Cannot read property 'documentation' of undefined"

Hi there!

I’ve trying to use serverless-aws-documentation, i’ve installed vía:

npm install serverless-aws-documentation

its listed OK when i use npm --list (also i installed reqvalidator plugin)
├── serverless-aws-documentation@1.1.0
└── serverless-reqvalidator-plugin@1.0.3

But when i do deploy it says:
TypeError: Cannot read property ‘documentation’ of undefined at ServerlessAWSDocumentation.afterDeploy

What i am missing? hope you can help me =).

Best!

Andrés
Here’s the whole log:

TypeError: Cannot read property ‘documentation’ of undefined
at ServerlessAWSDocumentation.afterDeploy (/mnt/c/Users/asanh/Desktop/neltume_services/putEvent2/node_modules/serverless-aws-documentation/src/index.js:91:26)
at /usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:521:55
at tryCatcher (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
at Object.gotValue (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/reduce.js:168:18)
at Object.gotAccum (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/reduce.js:155:25)
at Object.tryCatcher (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:729:18)
at _drainQueueStep (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:15:14)
at processImmediate (internal/timers.js:461:21)

Make sure to include documentation in custom section. We put the

plugins:
  - serverless-offline
  - serverless-aws-documentation
custom:
  documentation: 
      api:
        info:
          version: "1" # this will be ignored due to an issue in API Gateway doc export
          title: "My API" # this will be ignored due to an issue in API Gateway doc export
          description: "Sample Benchmarks API"
      models:...
1 Like

You re my hero! works great!

Although, i didn’t know that in order to put the plugin “aws-documentation” on my serverless, it had to be used somewhere in the same serverless file :S. At least they dont mention it on the aws-documentation-plugin docs

Thanks Again!