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.

Path error with SLS 1.18 when package individually is set

See original GitHub issue

This 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:closed
  • Created 6 years ago
  • Comments:15 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
HyperBraincommented, Jul 21, 2017

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.

0reactions
HyperBraincommented, Jul 26, 2017

as soon as I merged #130 I will prepare the release. Think it will be tomorrow.

Read more comments on GitHub >

github_iconTop 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 | Yarn - Package Manager
Fast, reliable, and secure dependency management.
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 >

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