serverless-layers
serverless-layers copied to clipboard
Bug in version 2.8.5
Zip always results in 0 MB
I went back to v2.5.4 and its working fine.
Since someone has already raised the issue, I won't repeat it again.
After some debugging, I found that the problem probably occurs here(L87):
https://github.com/agutoli/serverless-layers/blob/842eb7ce374af7a400e6cec2176bcc6f1882919c/src/package/Dependencies.js#L86-L101
In this flow, the copyProjectFile
method will be called multiple times to copy multiple files. The layersPackageDir
directory will be cleaned up after each entry, causing yarn --production
to be unable to complete the installation correctly.
I compared the source code between 2.7.0 and 2.8.5. It looks like the code in Dependencies.js at line 24 is causing the issue. After removing it, the issue was gone.
Looks like same issue here: https://github.com/agutoli/serverless-layers/issues/168
Same fix too