Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Support for Serverless v2 #187

Open
d-fay opened this issue Jul 8, 2021 · 3 comments
Open

Support for Serverless v2 #187

d-fay opened this issue Jul 8, 2021 · 3 comments

Comments

@d-fay
Copy link

d-fay commented Jul 8, 2021

This is a Feature Proposal

Description

NPM warns of possible compatibility issue with Serverless v2

Everything appears to work with sls-v2. Packaging just needs updating. Alerts are still being created during deployment.

When running npm audit fix we see the following warning:

npm WARN [email protected] requires a peer of serverless@^1.12.0 but none is installed. You must install peer dependencies yourself.

Additional Data

  • Serverless Framework Version: [email protected]
  • Stack Trace: N/A
  • Provider Error messages: when running npm audit fix...
npm WARN [email protected] requires a peer of serverless@^1.12.0 but none is installed. You must install peer dependencies yourself.

Alerts continue to be correctly created in AWS, but NPM doesn't expect the plugin to work.

@medikoo
Copy link
Contributor

medikoo commented Jul 16, 2021

@d-fay Latest version (v1.7.3) is configured to list servelress at v2:

https://github.com/ACloudGuru/serverless-plugin-aws-alerts/blob/v1.7.3/package.json#L42

Please upgrade

@tomchiverton
Copy link
Contributor

I've done npm i serverless-plugin-aws-alerts serverless-mysql serverless

...
+ [email protected]
+ [email protected]
+ [email protected]
added 630 packages from 391 contributors, updated 3 packages and audited 652 packages in 118.474s
...

yet still

$ sls deploy --aws-profile serverless-dev-extravision --stage live
 
  Type Error ---------------------------------------------
 
  TypeError: Cannot read property 'defineFunctionProperties' of undefined
      at new AlertsPlugin (/home/falken/workspace/serverless/bt-serverless-quiz/node_modules/serverless-plugin-aws-alerts/src/index.js:13:36)
      at PluginManager.addPlugin (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:84:28)
      at /usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:121:31
      at Array.forEach (<anonymous>)
      at PluginManager.loadAllPlugins (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:121:8)
      at /usr/local/lib/node_modules/serverless/lib/Serverless.js:98:35

serverless.yml :

custom:
  alerts:
    stages:
      - live
    topics:
      alarm:
        topic: ${self:service}-${opt:stage}-alerts-alarm
        notifications:
          - protocol: email
            endpoint: [email protected]
  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              12.22.7
     Framework Version:         1.77.1
     Plugin Version:            3.6.18
     SDK Version:               2.3.1
     Components Version:        2.33.0

@tomchiverton
Copy link
Contributor

Setting in package.json the plugin version to "1.6.1" fixes it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants