-
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
Cannot read property '1' of null #193
Comments
Your handler name seems not to match your actual handler file in
The versions 2.1.0 and beyond enforce correct configurations now - it was a bug that the plugin did not do proper checks of the service configuration consistence before, which led to quite unstable runtime behavior of the plugin. The important thing (especially from a sight of the Serverless framework) is, that the handlers are declared correctly, so your function definition should be:
in your webpack config you then should use the entry resolution mechanism, which makes sure that the webpack config is setup correctly for the service:
Alternatively you can build that all manually and make sure that your handlers match:
BTW: individual packaging of a service will only work with the automatic stuff enabled. Nevertheless I agree that the error message is wrong. It should emit something that points out that the handler file declared in the serverless.yml could not be found in that case. |
That seems like an AWS way of declaring the handlers. We are using Goole Cloud Functions which does not use the If you try to use that syntax with the
|
Thanks for the info. Hmmm. |
@huysamen One thing you additionally could try: can you try to change YOUR entry definition just to be an object and leave everything else as is?
Does that solve the crash? |
@HyperBrain the With the Let me try the entry object change quick. |
@HyperBrain tried changing the |
Ok. I'll check the template and do some tests. |
From the sample template it seems that for Google, the handler definitions in That would make it compile again with projects, that are structured like the sample template. This should end up in 2.2.1 then. A further thought (that's not directly related to this - obvious - bug) is, that individual packaging and per function optimization would not be possible due to the structure of the projects. I'll investigate that after the bug is fixed and I have gathered more information, why the layout has been chosen in the way it is - if it's a necessary requirement for Google or if it was chosen just on purpose. |
The fix has to be ported to v3 as soon as the v2 bugfix has been released. |
Released with 2.2.1 |
This is a Bug Report
Description
Unable to upgrade
serverless-webpack
beyond version2.0.0
. This happens on a basic example, after the template was generated withserverless
, and changing from Javascript to Typescript.For bug reports:
What went wrong?
As soon as we upgrade
serverless-webpack
past version2.0.0
it is unable to compile.What did you expect should have happened?
Upgrading from version
2.0.0
to2.1.0
(and beyond) should not break the compilation as no breaking changes are noted in the changelog.What was the config you used?
Additional Data
Serverless-Webpack Version you're using:
2.1.0
Webpack version you're using:
3.5.5
Serverless Framework Version you're using:
1.20.2
Operating System:
macOS Sierra 10.12.6
Stack Trace (if available):
The text was updated successfully, but these errors were encountered: