question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sls deploy function -f <function> not respecting entry slsw.lib.entries

See original GitHub issue

Bug Report

Description

Hi, I searched for this error but I could not find anything related.

serverless-webpack @ 5.3.5 works perfectly.

serverless-webpack @ 5.4.0 does not work as expected.

When I try to update only one function it tries to copy all the functions declared inside the serverless and not the one from slsw.lib.entries.

The whole process occurs OK, compilation and zip generation for just the function from slsw.lib.entries. But when the final process kicks in to copy the artifacts from .webpack to .serverless the plugin search for all the functions generation this error message (the function on the error message is the one not listed inside slsw.lib.entries):

ENOENT: no such file or directory, copyfile '/...../.webpack/<function>.zip' -> '.serverless/<function>.zip'

Obs.: I removed the full path and function name for simplicity.

  • Serverless-Webpack Version you’re using: 5.4.0
  • Webpack version you’re using: 5.27.1
  • Serverless Framework Version you’re using: 2.28.7
  • Operating System: Mac OS X 10.15.7
  • Stack Trace (if available):
Error: ENOENT: no such file or directory, copyfile '/......./.webpack/<function>.zip' -> '.serverless/<function>.zip'
      at Object.copyFileSync (fs.js:1991:3)
      at ServerlessWebpack.copyArtifactByName (/....../node_modules/serverless-webpack/lib/packageModules.js:86:6)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:33
  • Comments:18 (5 by maintainers)

github_iconTop GitHub Comments

6reactions
pgrzesikcommented, Apr 22, 2021

Hello 👋 ~Does someone have, by any chance, a minimal reproducible example that I could run on my side in order to debug/diagnose the problem?~ Nvm, managed to reproduce, will try to post PR with a fix as soon as possible.

5reactions
OskarKaminskicommented, Apr 6, 2021

Like @ffxsam said, package.individually: false is not optimal. Currently, the only option is to downgrade to v.5.3.5 or turn off the package.individually flag. Neither should be a solution.

I’d be glad if someone could review what caused the regression between v.5.3.5 and v.5.4.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Serverless framework deploy failing with serverless-webpack ...
I am in the beginning of learning the serverless framework and I am ... ["aws-sdk"], entry: slsw.lib.entries, devtool: slsw.lib.webpack.
Read more >
serverless slsw.lib.entries is always empty - Stack Overflow
exports = { entry: slsw.lib.entries, ... } in my serverless.yml I declare the function as following:
Read more >
How to optimize a serverless typescript eslint webpack setup ...
Here's what you can do to get the most out of it: ... entry: slsw.lib.entries, ... when running sls deploy for faster uploads...
Read more >
Rendering and Serving a Create-React-App from an Express ...
As a fun, little, proof-of-concept, I thought it would be interesting to see if I could get a Lambda function running an Express.js...
Read more >
Serverless Webpack in Lambda Simplified 101 - Learn | Hevo
There is no configuration. The sls package, sls deploy, and sls deploy function are all supported. Individual functions are packaged into Lambda ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found