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

'sls print' contains Warnings. #5676

Closed
shouki-s opened this issue Jan 11, 2019 · 1 comment · Fixed by #5728
Closed

'sls print' contains Warnings. #5676

shouki-s opened this issue Jan 11, 2019 · 1 comment · Fixed by #5728

Comments

@shouki-s
Copy link

This is a Bug Report

Description

  • What went wrong?

It came to occur since 1.36.0.
Output of sls print contains Warnings.

The reproduction code is as follows.

My serverless.yml:

service: servicename

provider:
  name: aws
  runtime: nodejs8.10

functions:
  function1:
    handler: lib/proxy.handler
  function2:
    handler: lib/proxy.handler

Yes, We have multiple functions having same handler.
The difference between the two functions is environment variables and so on.

shell script:

sls print

stdout:

Serverless: Warning: A handler "lib/proxy.handler" is duplicated in functions: function1, function2.
service: servicename
provider:
  name: aws
  runtime: nodejs8.10
functions:
  function1:
    handler: lib/proxy.handler
  function2:
    handler: lib/proxy.handler
  • What did you expect should have happened?

sls print should output valid yaml.
Warnings should be written to stderr. Otherwise, sls print should not output warnings.

  • What was the config you used?

As mentioned above.

  • What stacktrace or error message from your provider did you see?

Similar or dependent issues:

Add warning for multiple functions having same handler: #4414 #5638

// I think that this warning itself is useful.

Additional Data

  • Serverless Framework Version you're using: 1.36.0
  • Operating System: darwin
  • Stack Trace:
  • Provider Error messages:
@uneco
Copy link
Contributor

uneco commented Jun 24, 2020

This issue has recurred in versions that use logInfo / logWarning / logError.

const writeMessage = (title, message) => {
let line = '';
while (line.length < 56 - title.length) {
line = `${line}-`;
}
consoleLog(' ');
consoleLog(chalk.yellow(` ${title} ${line}`));
consoleLog(' ');
if (message) {
consoleLog(` ${message.split('\n').join('\n ')}`);
}
consoleLog(' ');
};

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

Successfully merging a pull request may close this issue.

4 participants