Serverless-webpack: Directory names that start with a dot are not being included in the zip file

Created on 25 Mar 2021  路  5Comments  路  Source: serverless-heaven/serverless-webpack

Bug

Description

After upgrading from 5.3.5 to 5.4.0 I started getting the error below, I noticed that archived was replaced by bestzip and this is exactly what is failing, not sure what is causing this issue but I use hidden folders (starting with dot) for auto generated code that is packaged by serverless and bestzip may not be able to find the folder.

  • What stacktrace or error message from your provider did you see?
zip error: Nothing to do! (../onAppInstanceSyncStorage.zip)

  Error --------------------------------------------------

  Error: Unexpected exit code from native zip: 12
   executed command 'zip --quiet --recurse-paths ../onAppInstanceSyncStorage.zip'
   executed in directory '/home/runner/work/hallway/hallway/server/server/dist/onAppInstanceSyncStorage'
      at ChildProcess.<anonymous> (/home/runner/work/hallway/hallway/node_modules/bestzip/lib/bestzip.js:86:13)
      at ChildProcess.emit (events.js:314:20)
      at ChildProcess.EventEmitter.emit (domain.js:483:12)
      at maybeClose (internal/child_process.js:1022:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)

Additional Data

  • Serverless-Webpack Version you're using: 5.4.0
  • Webpack version you're using: 4.44.2
  • Serverless Framework Version you're using: 1.83.3
  • Operating System: Any
bug

Most helpful comment

All 5 comments

I'm sorry about that error.
Is there any chance you can provide a simple project to reproduce the error? So we can track it down and update serverless-webpack or bestzip to fix the issue.
Thanks

let me try, my setup is pretty complex

Same question then: Is there any chance you can provide a simple project to reproduce the error?

@christiantakle thanks for the repo, it helped me a lot.
In fact, when we zip files, we use * to match all files. But, according to the doc, it does not include dotfiles by default.

I managed to fix it by providing a list of files to the zip command and then found the fix was already provided in an other PR: https://github.com/serverless-heaven/serverless-webpack/pull/777

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hassankhan picture hassankhan  路  3Comments

vladtamas picture vladtamas  路  5Comments

tommedema picture tommedema  路  4Comments

rvaidya picture rvaidya  路  4Comments

agreea picture agreea  路  3Comments