serverless-layers icon indicating copy to clipboard operation
serverless-layers copied to clipboard

Bug in version 2.8.5

Open OmarKhattab opened this issue 10 months ago • 2 comments

Zip always results in 0 MB Screen Shot 2024-03-28 at 12 57 16 AM

I went back to v2.5.4 and its working fine.

OmarKhattab avatar Mar 28 '24 07:03 OmarKhattab

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.

fl-wxiao avatar Apr 28 '24 09:04 fl-wxiao

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

franciszabala avatar May 23 '24 13:05 franciszabala