Open jdesrochers opened 2 years ago
I am also having this issue. I downgraded to serverless 2.72.3 for the time being, but for obvious reasons I don't want to keep it that way. Any work to fix this issue would be appreciated. I don't know much about writing plugins for serverless otherwise I would take a stab at it.
There looks to be a workaround for now. I was able to get this working on my setup to keep version 3: https://github.com/janders223/serverless-offline-ssm/issues/191
I've updated to serverless-offline-ssm
v6.1.0 but I'm still getting errors.
Environment: darwin, node 14.19.0, framework 3.7.5 (local), plugin 6.1.5, SDK 4.3.2
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issues
Error:
TypeError: Plugin is not a constructor
at PluginManager.addPlugin (/Users/julianalfonsoponce/xxxx/node_modules/serverless/lib/classes/plugin-manager.js:93:28)
I then added some logging and found out that ServerlessOfflineSSM
is wrapped in a default
key compared to other Plugin
[class AwsCompileCloudFrontEvents]
[class HttpApiEvents]
[class AwsDeployFunction]
[class AwsDeployList]
[class AwsInvokeLocal]
[class Standalone]
{ default: [class ServerlessOfflineSSM] } <<<<<<<<<<<<<<<<<<< this one
I've added console.log
within addPlugin
function of PluginManager
class
I think the export default ServerlessOfflineSSM
ended up breaking the plugin, maybe should be replaced to export = ServerlessOfflineSSM
. 😥😮💨
I'll do some tests and then do the PR fixing the problem.
Update: Follow the PR with the fix: https://github.com/janders223/serverless-offline-ssm/pull/266
@gustavopedroni thanks for the updates mate 🎉 🚀
The serverless-offline-ssm works fine with Serverless 2. However, it doesn't seem to work with Serverless 3. The following serverless.yml has the important snippets for the problem that we are seeing. This works with version 2 but not 3.
To start we use the following
Then we get this error
Line 57 has the following
The issue is that variableResolvers doesn't seem to exist in serverless 3. This works fine with serverless 2. Have not been able to find what the exact change was in serverless 3 or I would have looked at a PR option.