serverless / serverless-local-schedule

⚡️🗺️⏰ Schedule AWS CloudWatch Event based invocations in local time(with DST support!)
MIT License
72 stars 11 forks source link

TypeError: Cannot read property 'hasOwnProperty' of null #15

Open kkarczmarczyk opened 4 years ago

kkarczmarczyk commented 4 years ago

I have issue with this config:

events:
  - schedule:
    rate: cron(0 7 ? * ? *)
    timezone: Europe/Warsaw

Run sls deploy returns error:

Serverless:
Serverless: Converting local crontabs to UTC crontabs...
Serverless: [object Object]

  Type Error ---------------------------------------------

  TypeError: Cannot read property 'hasOwnProperty' of null
      at ServerlessLocalCrontabs.convertCrontabs (/Users/kkarczmarczyk/repo/harvey-serverless/node_modules/serverless-local-schedule/index.js:71:24)
      at /Users/kkarczmarczyk/.nvm/versions/node/v14.12.0/lib/node_modules/serverless/lib/classes/PluginManager.js:510:55
      at tryCatcher (/Users/kkarczmarczyk/.nvm/versions/node/v14.12.0/lib/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
      at Object.gotValue (/Users/kkarczmarczyk/.nvm/versions/node/v14.12.0/lib/node_modules/serverless/node_modules/bluebird/js/release/reduce.js:168:18)
      at Object.gotAccum (/Users/kkarczmarczyk/.nvm/versions/node/v14.12.0/lib/node_modules/serverless/node_modules/bluebird/js/release/reduce.js:155:25)
      at Object.tryCatcher (/Users/kkarczmarczyk/.nvm/versions/node/v14.12.0/lib/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
      at Promise._settlePromiseFromHandler (/Users/kkarczmarczyk/.nvm/versions/node/v14.12.0/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:547:31)
      at Promise._settlePromise (/Users/kkarczmarczyk/.nvm/versions/node/v14.12.0/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:604:18)
      at Promise._settlePromise0 (/Users/kkarczmarczyk/.nvm/versions/node/v14.12.0/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:649:10)
      at Promise._settlePromises (/Users/kkarczmarczyk/.nvm/versions/node/v14.12.0/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:729:18)
      at _drainQueueStep (/Users/kkarczmarczyk/.nvm/versions/node/v14.12.0/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:93:12)
      at _drainQueue (/Users/kkarczmarczyk/.nvm/versions/node/v14.12.0/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:86:9)
      at Async._drainQueues (/Users/kkarczmarczyk/.nvm/versions/node/v14.12.0/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:102:5)
      at Immediate.Async.drainQueues [as _onImmediate] (/Users/kkarczmarczyk/.nvm/versions/node/v14.12.0/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:15:14)
      at processImmediate (internal/timers.js:461:21)

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              14.12.0
     Framework Version:         2.8.0
     Plugin Version:            4.1.1
     SDK Version:               2.3.2
     Components Version:        3.2.7
kkarczmarczyk commented 4 years ago

I made PR with solution https://github.com/UnitedIncome/serverless-local-schedule/pull/16

matlex commented 3 years ago

I'm faced with the same error.