Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot destructure property 'log' of 'undefined' #165

Closed
siolfyr opened this issue Mar 25, 2022 · 2 comments · Fixed by #170
Closed

Cannot destructure property 'log' of 'undefined' #165

siolfyr opened this issue Mar 25, 2022 · 2 comments · Fixed by #170
Labels

Comments

@siolfyr
Copy link

siolfyr commented Mar 25, 2022

Describe the bug
TypeError: Cannot destructure property 'log' of 'undefined' as it is undefined.
at new Client (/Users/username/home/company/td-scheduler/node_modules/serverless-finch/lib/plugin.js:14:41)
at PluginManager.addPlugin (/Users/username/.nvm/versions/node/v14.19.0/lib/node_modules/serverless/lib/classes/PluginManager.js:92:28)
at /Users/username/.nvm/versions/node/v14.19.0/lib/node_modules/serverless/lib/classes/PluginManager.js:141:33
at Array.forEach ()
at PluginManager.loadAllPlugins (/Users/username/.nvm/versions/node/v14.19.0/lib/node_modules/serverless/lib/classes/PluginManager.js:141:8)
at Serverless.init (/Users/username/.nvm/versions/node/v14.19.0/lib/node_modules/serverless/lib/Serverless.js:213:30)
at async /Users/username/.nvm/versions/node/v14.19.0/lib/node_modules/serverless/scripts/serverless.js:589:7

 For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com

Your Environment Information ---------------------------
Operating System: darwin
Node Version: 14.19.0
Framework Version: 2.72.3
Plugin Version: 5.5.4
SDK Version: 4.3.2
Components Version: 3.18.2

Error makes sense to me, line 92 of PluginManager is this:
const pluginInstance = new Plugin(this.serverless, this.cliOptions); // No third parameter

To Reproduce
Run sls client deploy

Expected behavior
Not crash

Configuration

service: group-frontend
frameworkVersion: "2"
plugins:
  - serverless-finch
provider:
  name: aws
  region: us-east-2
  stage: ${opt:stage, 'dev'}
  environment:
    STAGE: ${opt:stage, 'dev'}
  runtime: nodejs14.x
  logRetentionInDays: 30
custom:
  client:
    bucketName: ${self:provider.stage}-${self:service}-bucket
    distributionFolder: dist
    indexDocument: index.html
    errorDocument: index.html

Operating system (please complete the following information):

  • OS: OS X 10.15
  • serverless framework version: In serverless logs
  • serverless-finch version = serverless-finch@4.0.0
@Shereef
Copy link
Collaborator

Shereef commented Mar 26, 2022

@siolfyr Thanks for your bug report!
The last version I tested with serverless@^2.X.X is actually serverless-finch@v2.8.0
When we went to V3 we tested with serverless@^3

I am not sure what needs to change to get this to work with serverless 2, however, I do know the while going to serverless 3 the logging mechanism changed.

You can either

  1. Upgrade to serverless 3
  2. Make a PR to make serverless-finch@4 compatible with serverless 2
  3. Downgrade to serverless-finch@2
  4. leave this issue to gather interest which I will then set aside some time to look into it and try to fix it

Sorry if this is not the answer you were looking for.

EDIT: If someone else is having the same issue please go ahead and add 👍 on the original issue above

@github-actions
Copy link

🎉 This issue has been resolved in version 4.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants