Hi all. I’ve just started migrating an existing AWS Lambda project to use serverless. I’m excited, serverless looks like it will remove a lot of my current pain.
My project uses ClojureScript, so I’m using serverless-cljs-plugin. This mostly works great but it doesn’t work with serverless-offline, which is one of my main reasons for switching to serverless. I’ve spend some time digging into the plugin, and I believe it’s because the plugin’s hooks don’t include the serverless-offline lifecycle events (e.g. like this).
In order to test and develop this locally, I’ve created a .serverless_plugins
directory and cloned the plugin into it, like this:
~/d/c/lambda (master)> tree .serverless_plugins
.serverless_plugins
└── serverless-cljs-plugin
├── LICENSE
├── README.md
├── index.js
├── package.json
<snip additional files>
However, now when I try to execute serverless offline
(without further modifying the cloned plugin project) I get errors like:
TypeError: _.get is not a function
at isLumo (/Users/colin/dev/cursive-site/lambda/.serverless_plugins/serverless-cljs-plugin/index.js:20:22)
<etc etc>
In the plugin, _
is bound to lodash, and this sounds to me like lodash isn’t being loaded correctly when the plugin is run locally. However I’m very much a newbie when it comes to JS/Node, so I have no idea why that might be. Can anyone help?