Getting "Cannot convert undefined or null to object" when running sls deploy

It seems to be rather generic when an unhandled error occurs in sls offline. I ended up putting some console.logs in the serverless-offline code to see where it was going wrong.

I think the issue is that this plugin has changed over time and that change is not well documented. I had the same issue that lead me here. I have code that is 7 months old that I pulled from a working repo down onto a new system(fresh serverless install). My old serverless.yml used to work but this is what is needed to follow the docs and fix you error likely.

You need to add to custom: the defaults (the default: below is just some tag and you can call anything) and at least have enabled set.
warmup:
default:
enabled: false # Whether to warm up functions by default or not

I did not have anything in the custom section and like I mentioned 7 months ago was working without the errors.

Then in each lamda you want to enable add (again needs the same tag you made above).
warmup:
default:
enabled: true

Before I just had warmup: enable: true. But to fix needs the tag.

Anyhow this is what the plugin states to do but the code I started from over a year and half ago did not have this way. Likely this plugin authors need to better document with a section called : changes that will break you code.

Hopefully saves others time