0

I have created a serverless boilerplate project using this command

sls create --template aws-nodejs-typescript --path my-project

I configured properly my AWS credantials thus I was able to depoly it successfully without any problem

sls deploy

But when I test de hello function I get the following error (after executing sls logs -f hello)

ERROR Uncaught Exception {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module 'handler'\nRequire stack:\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js","stack":["Runtime.ImportModuleError: Error: Cannot find module 'handler '","Require stack:","- /var/runtime/UserFunction.js","- /var/runtime/index.js"," at _loadUserApp (/var/runtime/UserFunction.js:100:13)"," at Object.module.ex ports.load (/var/runtime/UserFunction.js:140:17)","
at Object. (/var/runtime/index.js:43:30)"," at Module._compile (internal/modules/cjs/loader.js :999:30)"," at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)"," at Module.load (internal/modules/cjs/loader.js:863:32)"," at Func tion.Module._load (internal/modules/cjs/loader.js:708:14)"," at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)"," at intern al/main/run_main_module.js:17:47"]} END RequestId: 28588f41-1c4c-4391-82da-0c89bc1f9707 REPORT RequestId: 28588f41-1c4c-4391-82da-0c89bc1f9707 Duration: 164.91 ms Billed Duration: 165 ms Memory Size: 1024 MB Max Memory Used: 15 MB

Unknown application error occurred Runtime.ImportModuleError

I think the problem is in the Windows environment, because when I deploy the service with Mac it works with no issue ! Did I need an extra-configuration to use Serverless with windows ? Thanks for any suggestion

Smaillns
  • 2,540
  • 1
  • 28
  • 40
  • 1
    Does this answer your question? [Serverless Framework with AWS Lambda error "Cannot find module"](https://stackoverflow.com/questions/42880987/serverless-framework-with-aws-lambda-error-cannot-find-module) – esqew Jan 23 '21 at 10:42
  • @esqew still having the same issue althought I have no error while doing the ''npm install'' ! – Smaillns Jan 31 '21 at 20:29

0 Answers0