Open chrsdietz opened 7 years ago
Are you using the "serverless-webpack" plugin? Apparently there is no compatibility between "serverless-webpack" and "serverless-plugin-typescript"
I get the same error when I package individually. Not using serverless-webpack
.
ENOENT: no such file or directory, lstat '/Users/darbio/Repositories/api/.build/functions/workers/shared/email/emails/'
The plugin doesn't check for the individual function package variable, only reading the global one from the serverless.yml file.
https://github.com/graphcool/serverless-plugin-typescript/blob/master/src/index.ts#L149-L165
It looks like the function to include packaged items only looks at the global package property.
It's actually an issue with https://github.com/prismagraphql/serverless-plugin-typescript/blob/master/src/index.ts#L185-L195
That operation needs to be applied to any function that is marked as being packaged individually and not just when you package the entire service as individual packages. It only checks the global package property not the per function one.
was this ever fixed?
I'm also hitting this problem. We have one really small function that we would like to package individually but still deploy to the same api gateway. Right now we running up again this. Looks like the only solution might be to restructure the project and share the api gateway, ideally we'd like to avoid this.
I have a simple setup so far regarding a particular service.
The serverless.yml is setup like so:
Basically, the
UploadAudio
function has a dependency on ffmpeg, so I want to package this individually to keep the size of the other functions down.However, I get this error:
I'm not sure why. I can also verify that the
uploadAudio.zip
file exists in the.build/.serverless
folder during the build process. In fact, the file does get copied over to the final.serverless
folder after the build throws the error.I still get this error if I remove the
include
section. It seems to be an issue with theindividually
parameter.It compiles and packages just fine if I don't set this to compile individually and just
include
the library in to the entire service. This is not ideal as the other functions do not need this library.Is there a configuration or something that I am missing?