Open sohailalam2 opened 6 years ago
Hi @sohailalam2 . Can you post your serverless.yml. I think it has something to do with your handler definitions of the functions that are used to create the entry points in the plugin.
Hey @HyperBrain ... its already added with the issue... please check the What was the config you used? section. Thanks Also, just FYI, I tried using the serverless generator serverless-google-cloudfunctions without the serverless-webpack and it does work.. the function was deployed successfully.
@sohailalam2 Indeed - I missed that 😄
However maybe we should ask someone who uses Google (I only use AWS right now) to get a fast solution for the problem. Imo it should be some configuration issue because others are using it successfully.
@gastonmorixe Can you help out here? I saw in #309 that you also use Google as provider.
@sohailalam2 Just comparing his sls.yml and yours, I see that he uses a switched plugin order. Can you also use tha same one, because within serverless the order is important?
@HyperBrain Thanks for the comment... I did tried changing the order and ended up with the same issue.
@pmuens Do you have any advice when using the Google provider plugin together with serverless-webpack
and can help out here?
I changed entry: slsw.lib.entries
to just index.js
(where my function is)
And this error goes away.
it seems like the root cause is slsw.lib.entries
is not finding the correct file in this case.
Anyway, works fine after you just point entry to the right thing.
BTW I was getting this error because I'm a noob and I didn't read the documentation. For anyone else running into this, just running webpack
throws this error, but running serverless webpack --out dist
works and gives webpack the proper entries value.
@joshughes this is ok for a single entry point, however, for complex projects, we can easily have multiple entry points and then it would be a pain to maintain all of those manually. slsw.lib.entries
must return and wire up the entries as expected. This happens without any issue with the AWS provider.
@HyperBrain any update on this?
@sohailalam2 This seems to originate from different handler specifications when using AWS and Google. As I do not use Google at work nor for my private projects, can you post a sample of the function definitions or a sample repo (a bit more complex) where we can try to debug? In the original serverless.yml of the issue, it also seems that there is no "exported function" defintion in the handler defintion (http
vs. http.handle
). It might be, that this is the root of the issue.
If Google functions use a different semantics for the handler declarations, the plugin should interpret them differently than with AWS. That should solve the problem.
I'm also having a lot of trouble getting it to work with Google Cloud Functions (https://github.com/serverless/serverless-google-cloudfunctions)... it does not seem to support package.individually: true
. Did you guys end up with a solution? Thanks!
Just get sure within your serverless.yml your- ${file(functions/function.yml)} path is ok
Bug Report
Description
Missing entry point(s) when using serverless-google-cloudfunctions
For bug reports:
What went wrong? The entry point(s) of the compilation was an empty object
What did you expect should have happened? The entry point(s) of the compilation should contain the entries
What was the config you used? serverless.yml
webpack.config.js
For feature proposals:
Similar or dependent issue(s):
Additional Data