-
Notifications
You must be signed in to change notification settings - Fork 157
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
Non flat directory structure #2
Comments
I can't figure out whether it's a Webpack configuration problem or an issue with the serverless-webpack plugin, though I am leaning toward the former. Where I I'll keep experimenting and report back if I can find a solution. In the meantime, if anyone happens to have a suggestion, please do advise! :) |
I spent a bit of time on it on the weekend and I also think it's the former. I can create a function under |
@andrewoh531 Thanks for investigating. Let me take a look and figure out what is going on. |
@andrewoh531 @jangerhofer I couldn't reproduce with my test setup. Here's what I have: serverless.yml
controllers/deep/test_deep.js
Deploy:
Request:
Let me know if you guys are seeing other wise. |
Been playing around with it a bit more. I'm not sure how @jangerhofer reproduced the issue but issue seems to be related to importing specific modules. Importing a module from the handler is fine for most cases, it's just specific module import that it errors on. Also it's only reproducible when deployed. Invoking it locally is fine. I have a very simple handler and trying to import Below is a snippet of my code:
|
Looking into this further it appears to be related to peer dependencies. Is this an issue with |
@andrewoh531 I looked into it a bit. There are some specific things However, your case of specifying a dependency in
Can you share the handler function that is causing a problem? And your |
Hi jayair, yes I did see the reference on it in The handler and
|
@andrewoh531 Thanks I'll try it out. It's interesting because you don't really need to specify the |
R u talking about removing
|
Oh not that. Try removing this line https://github.com/AnomalyInnovations/serverless-es7/blob/master/webpack.config.js#L29 and this line https://github.com/AnomalyInnovations/serverless-es7/blob/master/serverless.yml#L22. |
@andrewoh531 I am having the same problem. It just kills the lambda due to that import. Can't figure out why. Runs on sls invoke local just fine. Could you share your exact line for a workaround? I tried everything at this point. Edit: tried just dynogels plain and that does not work either. Something about it does not play nice with web pack I guess. |
@hammadzz sorry for the late reply. It's been awhile but I think I ended up scrapping ES7. I wanted to use async/await but eventually decided the trouble wasn't worth it. |
@andrewoh531 I don't think it was webpack babel setup. Turns out something else was whack with the lambda itself. After increasing the memory to 512mb it kind of flushed out and worked. It seems Lambda had frozen up and it wasn't just the memory issue. I would delete it and recreate with more memory and try. In the end dynogels-promisified worked for me in lambda with es6/es7 syntax (transpiled ofcourse) |
Is it possible to have a non-flat directory structure? I'm trying to put my functions under:
I've updated my
serverless.yml
configuration's handler tosrc/functions/hello.handler
. I'm able to run it locally but when I deploy it and then attempt to execute it I get the error:The text was updated successfully, but these errors were encountered: