Path error with SLS 1.18 when package individually is set
See original GitHub issueThis is a Bug Report
Description
I have a few services in the same project, so I made a script to gather the and deploy them one by one. On my machine everything goes fine, but when I run it on AWS CodeBuild, our CI, it fails.
projects.forEach(project => {
console.info('Deploying', project);
child_process.exec(`sls deploy`, { cwd: join(srcFolder, project) }, (err, stdout, stderr) => {
if (err) {
console.log('Error!', err);
} else {
console.log('STDOUT:', stdout);
console.log('STDERR:', stderr);
console.info('Finished', project);
}
});
});
And here is the error:
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.basename (path.js:1357:5)
at functionNames.forEach.name (/codebuild/output/src838467009/src/node_modules/serverless-webpack/lib/cleanup.js:27:28)
at Array.forEach (native)
at fse.copy (/codebuild/output/src838467009/src/node_modules/serverless-webpack/lib/cleanup.js:23:31)
at doneOne (/codebuild/output/src838467009/src/node_modules/fs-extra/lib/copy/ncp.js:237:40)
at /codebuild/output/src838467009/src/node_modules/fs-extra/lib/copy/ncp.js:122:11
at /codebuild/output/src838467009/src/node_modules/graceful-fs/polyfills.js:239:18
at FSReqWrap.oncomplete (fs.js:123:15)
at ChildProcess.exithandler (child_process.js:202:12)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:852:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) killed: false, code: 1, signal: null, cmd: 'sls deploy' }
- Serverless-Webpack Version you’re using: ^2.0.0
- Webpack version you’re using: ^3.3.0
- Serverless Framework Version you’re using: ^1.17.0
- Operating System: Should be Ubuntu
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (11 by maintainers)
Top Results From Across the Web
Serverless Custom Packaging Plugin
You define a path that you want to package inside of serverless's package property. The plugin then packages your code, such that te...
Read more >serverless-webpack - npm
TypeScript icon, indicating that this package has built-in type ... Fixed path exception bug with individual packaging and SLS 1.18 #159.
Read more >serverless - UNPKG
13, - **AWS Deploy:** Ensure to handle artifact stream read errors ... 248, - Do not exclude layer paths when packaging a layer ......
Read more >Serverless Webpack in Lambda Simplified 101 - Learn | Hevo
The sls package, sls deploy, and sls deploy function are all supported. Individual functions are packaged into Lambda deployment packages ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The error happens in the cleanup when
package.individually
has been set. See cleanup.js.This maybe related to #120 - individual packaging does not work properly. According to the source, the function’s artifact property must be unset.
We should try to setup a simple project where it can be reproduced locally and then it should be solved together with #120.
as soon as I merged #130 I will prepare the release. Think it will be tomorrow.