serverless-domain-manager: TypeError: Cannot read property 'domainName' of undefined

Community Note

  • Please vote on this issue by adding a đź‘Ť reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave “+1” or “me too” comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Bug Report

Error Description A clear and concise description of the behavior.

Command Run sls deploy

( sls create_domain )

Console Output

 Type Error ----------------------------------------------
 
  TypeError: Cannot read property 'domainName' of undefined
      at ServerlessCustomDomain.addOutputs (/github/workspace/node_modules/serverless-domain-manager/dist/src/index.js:559:38)
      at ServerlessCustomDomain.<anonymous> (/github/workspace/node_modules/serverless-domain-manager/dist/src/index.js:246:22)
      at Generator.next (<anonymous>)
      at fulfilled (/github/workspace/node_modules/serverless-domain-manager/dist/src/index.js:5:58)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

For sls create_domain:

  Error: Unable to create domain api.example.org
      at ServerlessCustomDomain.<anonymous> (/github/workspace/node_modules/serverless-domain-manager/dist/src/index.js:182:23)
      at Generator.throw (<anonymous>)
      at rejected (/github/workspace/node_modules/serverless-domain-manager/dist/src/index.js:6:65)
      at processTicksAndRejections (internal/process/task_queues.js:97:5)

Domain Manager Configuration Replace this with your own serverless.yml file (anonymized, of course) to help us better resolve your issue.

custom:
    customDomain:
        domainName: api.example.org
        basePath: ''
        certificateName: 'example.org'
        createRoute53Record: true
        endpointType: regional
        apiType: http
        securityPolicy: tls_1_2

Versions

  • Domain Manager version(s): 5.1.0
  • Serverless Version: 2.41.0
  • Lambda Code: Javascript
  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              14.16.1
     Framework Version:         2.41.0
     Plugin Version:            4.6.0
     SDK Version:               4.2.2
     Components Version:        3.9.2

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 40
  • Comments: 17

Most upvoted comments

Hello, you can use export SLS_DEBUG=* to know the cause of error. In my case, it said that the cause of error was “certificateArn must be in us-east-1 region”.

Hello, you can use export SLS_DEBUG=* to know the cause of error. In my case, it said that the cause of error was “certificateArn must be in us-east-1 region”.

In my case, the error was that the plugin wasn’t creating the custom domain name without the flag autoDomain explicitly set to true. After enabling debug and reading a piece of the code I was able to fix the problem. I am not sure that this is a bug, but the original error wasn’t too friendly. Anyway, the plugin is working for me.