serverless-offline icon indicating copy to clipboard operation
serverless-offline copied to clipboard

Serveless-offline plugin installation problem

Open ashachar opened this issue 10 years ago • 8 comments

Serverless Framework Version: 1.0.0-beta.2

Operating System: OS X

Expected Behavior:

I've followed steps a and b listed here: https://github.com/dherault/serverless-offline/tree/serverless_v1 Then, in step b, Upon adding the following to serverless.yml:

plugins:

  • serverless-offline

And invoking "serverless", the console should display Offline as one of the plug-ins now available in your serverless project.

Actual Behavior: TypeError: Plugin is not a constructor

Stack-Trace (Optional):

TypeError: Plugin is not a constructor at PluginManager.addPlugin (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:150:28) at servicePlugins.forEach (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:186:12) at Array.forEach (native) at PluginManager.loadServicePlugins (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:183:20) at PluginManager.loadAllPlugins (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:33:10) at service.load.then (/usr/local/lib/node_modules/serverless/lib/Serverless.js:60:28)

ashachar avatar Aug 24 '16 12:08 ashachar

Thanks will check it out in a bit.

Bilal-S avatar Aug 24 '16 18:08 Bilal-S

FWIW, I also just set this up today on OS X, also with 1.0.0beta2 and it's working for me... @ashachar what are your node/npm versions? Mine are:

○ → npm --version
3.8.6
○ → node --version
v6.0.0

bglusman avatar Aug 24 '16 18:08 bglusman

Thanks. $ npm --version 3.10.3 $ node --version v6.3.1

ashachar avatar Aug 24 '16 19:08 ashachar

I was able to replicate. This only happened to me when I used the serverless-offline 0.5 code. Can you double check that you cloned the serverless_v1 branch and overridden the code correctly inside your project? Serverless-offline 0.5 does not have a class constructor as it was not needed.

Bilal-S avatar Aug 24 '16 22:08 Bilal-S

Worked like a charm, thank you Bilal.

ashachar avatar Aug 25 '16 01:08 ashachar

@Bilal-S Thanks Bilal!

dherault avatar Aug 25 '16 13:08 dherault

I have double checked and reinstalled serverless 1.0.3 and serverless-offline 3.2.1.

I am getting the follwoing when running serverless. Any ideas?

TypeError: Plugin is not a constructor at PluginManager.addPlugin (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:28:28)

tniermann avatar Oct 31 '16 19:10 tniermann

Hi @tniermann , can you open a new issue about this? This is concerning, thanks.

dherault avatar Oct 31 '16 19:10 dherault