Skip to content
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

Fix for only one function deploy #292

Open
Marcosl14 opened this issue Jun 7, 2023 · 0 comments
Open

Fix for only one function deploy #292

Marcosl14 opened this issue Jun 7, 2023 · 0 comments

Comments

@Marcosl14
Copy link

When I try to deploy only one function using layers, I got the next error:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined

And it is produced, because the function moveArtifacts() in the index.ts is looking for the service.layers[name].package.artifact which should be generated during the entire stack deploy.

So when deploying only one function with sls deploy --stage stage --region us-east-1 --verbose -f functionName, the code is trying to find the layer artifact which is generated when deploying the full stack (so... it doesn't exists at this point).

If I add the property artifact to the layer pointing to .serverless/libraries.zip I was able to deploy the function, but when I tried to deploy the stack, I recieved the next error: OperationalError: ENOENT: no such file or directory, because it was already not generated.

So, the fix is in the index file in the moveArtifacts() function.

image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant