-
Notifications
You must be signed in to change notification settings - Fork 417
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
5.3.0: Handler 'handler' missing on module #505
Comments
@serverless-heaven/serverless-webpack-team @serverless-heaven/serverless-webpack-contributors Any idea what could have caused this regression? |
Same problem here, I'm also using webpack.config.js
|
@Hugoo @joebernard Can anyone of you provide a sample setup that can be used to reproduce (and investigate) the issue? |
@HyperBrain , sure, I uploaded a simple repo here : https://github.com/Hugoo/sls-webpack-bug I didn't try it on AWS but by using Please let me know if you want more details. |
@HyperBrain sorry for the delayed response, not had a chance to upgrade production projects to v5.3.0 yet. @Hugoo thanks for uploading the sample repo |
Fully agree! Lets revert the commit and I'll release the version as 5.3.1.
I just checked that master contains only bug fixes right now, so merging
the revert with a subsequent release will be fine.
…On Sun, Jun 2, 2019 at 11:21 PM Hassan Khan ***@***.***> wrote:
Hi all, I've gone through the commit log using @Hugoo
<https://github.com/Hugoo>'s sample repo and I've narrowed it down to PR
#450 <#450>.
I think the quickest fix would be to revert the commit, thoughts?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#505?email_source=notifications&email_token=ABKEZXWQP2JSNLHYE7ZYADDPYQ2TRA5CNFSM4HOQHNPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWX6ICI#issuecomment-498066441>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABKEZXQFLRY6QETGJAAAXZLPYQ2TRANCNFSM4HOQHNPA>
.
|
@Hugoo @joebernard @hassankhan I pushed a revert commit of #450 to master. |
Very strange. Would be good if @TheLarkInn could share some insights. Thanks |
Yes, but for a quick fix we'll go with the revert for 5.3.1 and we should
analyze what exactly happens.
It even might be related to specific versions of webpack or babel.
However, we can get it in for a future version (probably 5.4.0) as soon as
we can add the change properly without
side effects.
…On Fri, Jun 7, 2019 at 4:58 AM Steve Mao ***@***.***> wrote:
Very strange. Would be good if @TheLarkInn <https://github.com/TheLarkInn>
could share some insights. Thanks
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#505?email_source=notifications&email_token=ABKEZXQS66QNPV36XDWWW3DPZHFEXA5CNFSM4HOQHNPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXEW5YY#issuecomment-499740387>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABKEZXWYTB5PJSXP3CSNGVTPZHFEXANCNFSM4HOQHNPA>
.
|
It works for me! |
This looks good to me. |
Released as 5.3.1 |
Release 5.3.1 solved this problem for me. Thank you ! |
This reverts commit 9f4500e, reversing changes made to 557170b. Fixes serverless-heaven#505
This is a (Bug Report / Feature Proposal)
Bug Report
Description
For bug reports:
Upgrading from 5.2.0 to 5.3.0 causes Lambda to not recognize
exports.handler
within the webpack generated Lambda function. Upon upgrading and runningsls deploy
, a Lambda function with animport
statement will return the following error:Upon rolling back to 5.2.0 and another
sls deploy
, thehandler
is recognized again.What did you expect should have happened?
The packager should not obscure
exports.handler
.What was the config you used?
package.json
webpack.config.js
from serverless.json
Additional Data
The problem only seems to arise with lambda functions using
import
. If the function does not contain an import, it seems to be understood by Lambda (it finds the handler). I created a simple test function and packaged two versions of it using 5.3.0. One has an import, the other does not. The imported file is also very simplistic and just contains aconsole.log()
. Here is a selection of the generated output from each:without import:
with import
When the file contains an import, the function containing
exports.handler
is wrapped in parenthesis. Perhaps this is causing Lambda to not seehandler
somehow. This was the only difference I could find between the generated files.The text was updated successfully, but these errors were encountered: