-
Notifications
You must be signed in to change notification settings - Fork 232
Open
Description
Hello,
I got an issue with the package 'individually' not working. I have setup a simple project to easily test it:
serverless.yml:
service: sls-ts-package-individually
frameworkVersion: "3"
configValidationMode: error
plugins:
- serverless-plugin-typescript
provider:
name: aws
runtime: nodejs18.x
package:
individually: false
patterns:
- src/**
functions:
one:
handler: src/main.handler1
two:
handler: src/main.handler2
three:
handler: src/main.handler3
package:
individually: true
patterns:
- "!src/not_included_in_3"package.json
{
"name": "test-sls-ts-package-individually",
"version": "1.0.0",
"description": "To test package individually",
"license": "UNLICENSED",
"private": true,
"scripts": {
"build": "tsc"
},
"devDependencies": {
"@types/aws-lambda": "^8.10.131",
"@types/node": "^18.11.9",
"serverless": "^3.38.0",
"serverless-plugin-typescript": "^2.1.5",
"typescript": "~4.7.4"
},
"dependencies": {}
}src/main.ts
import { Handler } from "aws-lambda";
export const handler1: Handler = async () => {
console.info("Hello function one!");
};
export const handler2: Handler = async () => {
console.info("Hello function two!");
};
export const handler3: Handler = async () => {
console.info("Hello function three!");
};- It also need a file named
src/not_included_in_3
Then when I type sls package, I got this error:
Running "serverless" from node_modules
Packaging sls-ts-package-individually for stage dev (us-east-1)
Compiling with Typescript...
Using local tsconfig.json - tsconfig.json
Typescript compiled.
Warning: Package patterns at function level are only applicable if package.individually is set to true at service level or function level in serverless.yaml. The framework will ignore the patterns defined at the function level and apply only the service-wide ones.
Environment: linux, node 18.19.0, framework 3.38.0 (local) 3.10.2v (global), plugin 7.2.0, SDK 4.5.1
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issues
Error:
Error: Error: Error: ENOENT: no such file or directory, open '/home/user/git/test/test-sls-ts-package-individual/.build/.serverless/three.zip' encountered during hash calculation for provided filePath: /home/user/git/test/test-sls-ts-package-individual/.build/.serverless/three.zip
at ReadStream.<anonymous> (/home/user/git/test/test-sls-ts-package-individual/node_modules/serverless/lib/plugins/aws/package/lib/get-hash-for-file-path.js:23:13)
at ReadStream.emit (node:events:517:28)
at ReadStream.emit (node:domain:489:12)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)If I disable the plugin serverless-plugin-typescript it's working fine. And I got 2 package in .serverless directory without error:
sls-ts-package-individually.zipthree.zip
Can this be fixed?
Thank you,
Bruno
Metadata
Metadata
Assignees
Labels
No labels