ar90n / serverless-s3-local

Serverless s3 local plugin.
MIT License
215 stars 70 forks source link

Getting Error: Cannot find module when used with serverless-webpack s3 event lambda invokation. #276

Open gghukasyan opened 3 years ago

gghukasyan commented 3 years ago

When using serverless with typescript/webpack, all the code is being compiled into .webpack folder on my machine but the way the lambda function is being invoked, it is not looking into .webpack folder. Error: Cannot find module '/Users/garegin/Projects/myproj/src/functions/s3-event-listener' Require stack:

jonnyasmar commented 3 years ago

Having the same issue here. Did you ever figure out a solution or workaround for this?

jonnyasmar commented 3 years ago

And just like that. Publicize your problem and the solution comes to mind right away 😅

Looks like you just need to ensure the serverless-webpack plugin declaration comes before serverless-s3-local, e.g.

plugins:
  - serverless-webpack
  - serverless-s3-local
ar90n commented 3 years ago

@gghukasyan I'm sorry for my late reply. I didn't recognize your comment.

@jonnyasmar Thank you for your great sharing of a workaround to this issue. It sounds great!