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 find module 'handler' #323

Closed
amtzm93 opened this issue Sep 10, 2022 · 2 comments
Closed

Cannot find module 'handler' #323

amtzm93 opened this issue Sep 10, 2022 · 2 comments

Comments

@amtzm93
Copy link

amtzm93 commented Sep 10, 2022

Hello, I'm submitting the issue cause this error is throwing me in my serverless project after upgrading the serverless-plugin-warmup from version 4.9.0 to 8.0.0.

ERROR	Uncaught Exception 	
{
    "errorType": "Runtime.ImportModuleError",
    "errorMessage": "Error: Cannot find module 'handler'\nRequire stack:\n- /var/runtime/index.mjs",
    "stack": [
        "Runtime.ImportModuleError: Error: Cannot find module 'handler'",
        "Require stack:",
        "- /var/runtime/index.mjs",
        "    at _loadUserApp (file:///var/runtime/index.mjs:951:17)",
        "    at async Object.UserFunction.js.module.exports.load (file:///var/runtime/index.mjs:976:21)",
        "    at async start (file:///var/runtime/index.mjs:1137:23)",
        "    at async file:///var/runtime/index.mjs:1143:1"
    ]
}

I know that serverless-plugin-warmup is working because it created the Warm Up Lambda with its configuration. But after that, all lambda functions can't be found, even if the lambda doesn't have the warm-up event, it can't be found.

Versions:

NodeJs: 16.x
Serverless: ~3.19.0
Serverless Plugin Warmup: ^8.0.0
Serverless Webpack:  5.9.1
Serverless Offline: 9.1.0

The functions configuration declared in the serverless.yml hasn´t been modified because previously the serverless-plugin-warmup every function was working and also, using serverless-offline, the project is working fine.


The warmup configuration in serverless.yml

warmup:
    default:
      cleanFolder: false
      name: custom-Name-Lambda
      events:
        - schedule: 'rate(5 minutes)'
      package:
        individually: false
      prewarm: true
      concurrency: 10 # Warm up 10 concurrent instances
@juanjoDiaz
Copy link
Owner

Hi @amtzm93,

Are you declaring serverless-plugin-warmup after serverless-webpack?

Can you create a sample project to reproduce the issue?
Otherwise there isn't much that I can't do to help....

@juanjoDiaz
Copy link
Owner

Closing since there was no response. Feel free to reopen if needed.

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

2 participants