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

Deploy produces an error: cannot find module '../lib/plugins/aws/lib/monitorStack' #217

Open
ShtiviGrin opened this issue May 30, 2022 · 4 comments

Comments

@ShtiviGrin
Copy link

Hi,
I'm trying to use this package in my project and I ran into a strange issue.

My serverless.yml file looks as follows:

service: "sls-alias-test"

plugins:
  - serverless-aws-alias

provider:
  name: aws
  runtime: nodejs14.x
  region: us-east-1

functions:
  foo:
    handler: src/index.handler

and when I run sls deploy --alias v1 I get the following error:

Error: Cannot find module '/Users/user/Desktop/Code/sls-alias-test/node_modules/serverless/lib/plugins/aws/lib/monitorStack'
- /Users/user/Desktop/Code/sls-alias-test/node_modules/serverless-aws-alias-fixed/index.js
- /Users/user/Desktop/Code/sls-alias-test/node_modules/serverless/lib/utils/import-module.js
- /Users/user/Desktop/Code/sls-alias-test/node_modules/serverless/lib/classes/plugin-manager.js

package.json:

{
  "name": "sls-alias-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "serverless": "^3.18.2",
    "serverless-aws-alias-fixed": "^2.0.1"
  }
}

have anyone else ran into that issue and managed to figure it out?
thanks!

@DanielStout5
Copy link

It looks like this is caused by this line in serverless-aws-alias-fixed:

const monitorStack = require(
	Path.join(this._serverless.config.serverlessPath,
		'plugins',
		'aws',
		'lib',
		'monitorStack')
);

In the recent versions of Serverless, it's called monitor-stack not monitorStack.

I was going to create a copy to fix this, but it looks like this person already did: https://github.com/Psycholive/serverless-aws-alias

So you can change the dependency to:

"serverless-aws-alias-v3": "3.2.0"

@zumby
Copy link

zumby commented Jun 25, 2022

this is so annoying :)

@kevincua-umbocv
Copy link

this is so annoying :)

yeah this is a very irritating issue

@franciscomemoli
Copy link

franciscomemoli commented Jul 21, 2022

looks like all the serverless/lib/plugins/aws/lib/* files change from snake case to dash case, so typical problems on serverless framework.

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

No branches or pull requests

5 participants