-
-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to serverless package when no lambdas exist #503
Comments
This also occurs if a repo does define lambdas, but they all have |
I am experiencing the same issue. My use case is that I am working on a workshop and I want to start from an empty project (with no Lambda), but with some initial setup already done (like all the necessary plugins installed) as these steps are irrelevant to what I want to show. |
This also happens to me when I try to run I had to adjust This is preventing my team from upgrading our lambdas to One workaround we've found is to create the empty folder But it's not an ideal solution. |
I believe this bug was introduced by #484, specifically this line in if (this.functionEntries?.length > 0) { // <-- this
await this.bundle();
await this.packExternalModules();
await this.copyExtras();
await this.pack();
} By removing this if condition (i.e. reverting to before the PR), the error is gone and successfully packaged. I have created a PR #545 with this fix. |
This error keeps occurring, and the above proposed solution fixes it. My team need this to upgrade to Node 20. |
Describe the bug
When attempting to create a serverless package without any lambdas (and therefore code for
esbuild
to compile), the package step fails with an errorError: ENOENT: no such file or directory, lstat 'PATH_TO_REPO/.esbuild/.serverless'
It seems to be looking for the
.serverless
folder in the wrong place (within the.esbuild
folder).To Reproduce
serverless
,esbuild
, andserverless-esbuild
.serverless.yml
file that doesn't define any lambdas.serverless package
Error: ENOENT: no such file or directory, lstat 'PATH_TO_REPO/.esbuild/.serverless'
Expected behavior
If there are no lambdas to package then
serverless-esbuild
does no work and the package step succeeds.Screenshots or Logs
Versions (please complete the following information):
"esbuild": "0.19.4",
"serverless": "^3.35.2",
"serverless-esbuild": "1.48.5"
Additional context
This issue was introduced in
[email protected]
as it's the first version that shows this behaviour.We try to install a base set of plugins across multiple repos - even those which are purely infrastructure/CloudFormation with no code. While esbuild and this plugin is not required in this repo and does not provide any benefit, we would still expect it to not cause any issues.
The text was updated successfully, but these errors were encountered: