For bug reports:
serverless-webpack is stopping me from deploying lambda containers as part of my service that are not
it should not have touched them as they're not relevant to webpack
N/A
I assume this is related to https://github.com/serverless-heaven/serverless-webpack/pull/723, which I can see the sense in - however, I can't see a way to say "this isn't a container image that Webpack cares about" and hence ignore that lambda in the service definition. Ideally there'd be an option to opt in/out of either Webpack's involvement in particular functions, or container functions as a whole as not all container functions are guaranteed to be part of the service.
$ /Users/chris/Code/report-support/node_modules/.bin/serverless deploy -v --stage dev
Serverless: Using configuration:
{
"webpackConfig": "api/webpack.config.js",
"includeModules": {
"forceInclude": [
"pg"
]
},
"packager": "yarn",
"keepOutputDirectory": true,
"packagerOptions": {},
"concurrency": 12
}
Serverless Error ----------------------------------------
No matching handler found for 'apollo' in 'XXX'. Check your service definition.
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information ---------------------------
Operating System: darwin
Node Version: 14.16.1
Framework Version: 2.41.1 (local)
Plugin Version: 4.6.0
SDK Version: 4.2.2
Components Version: 3.9.2
For what I understand you are mixing both container and regular JavaScript function in the same serverless config?
Any chance to share a short config to reproduce?
service: report-support
provider:
name: aws
region: eu-west-2
runtime: nodejs12.x
stage: ${opt:stage, 'dev'}
versionFunctions: false
plugins:
- serverless-webpack
functions:
server:
image:
uri: ${env:DOCKER_IMAGE}
entryPoint:
- /app/node_modules/.bin/aws-lambda-ric
command:
- apollo.lambda
role: LambdaGraphQlRole
migrate:
handler: db/migrate.up
role: LambdaGraphQlRole
rollback:
handler: db/migrate.back
role: LambdaGraphQlRole
custom:
webpack:
webpackConfig: api/webpack.config.js
includeModules:
forceInclude:
- pg
packager: yarn
keepOutputDirectory: true
Could you test again using the 5.5.1? Thanks 馃檹
Sadly not:
Serverless Error ----------------------------------------
No matching handler found for 'apollo' in '/builds/culture-shift/report-support'. Check your service definition.
From where the apollo coming from? I can't see a reference to it in the serverless.yml you shared.
in the definition of the server function, I would assume it's looking at the command of the lambda
Could you explain me what apollo.lambda is referencing to?
According to what was done here https://github.com/serverless-heaven/serverless-webpack/pull/723 and how it is supposed to work here, there should be a apollo.js file which export a lambda function. Isn't?
apollo.lambda is the command passed to the container image. The problem seems to be that it's incorrectly being interpreted as a JavaScript function, so it's looking for a function called lambda inside an apollo.js file - but that's not the case. It's just the command passed to the container. The problem appears to be serverless-webpack is trying to build it, but it's not a container image that Serverless is building itself (because the image has a uri field, it refers to an externally built image, not one built by Serverless). Ideally serverless-webpack shouldn't be trying to get involved in container images that the serverless framework isn't building
@cnorthwood could you check my attached PR? I've skipped off function when image.uri is defined.
Unfortunately that doesn't seem to have changed anything
You still have the same error when using my PR?
I've tried locally using a simple function and it worked, with my PR I don't have the error anymore.
functions:
server:
image:
uri: http://localhost
command:
- apollo.lambda
with apologies, it looks like I failed to change to the right branch - yes, that appears to be correct now
Good news!