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.

RangeError: Maximum call stack size exceeded with customize formatter

See original GitHub issue

See below codes

var winston = require('winston');
var request = require('request');
var util = require('util');

var logger = new (winston.Logger)({
  transports: [new winston.transports.Console({
    level: 'info',
    exitOnError: false,
    json: false,
    formatter: function defaultFormatter(options) {
      console.log('formatter is called');
      return options.message + '\n' + util.inspect( options.meta, {depth: 1});
    }
  })]
});

request.get('http://www.google.com', function(err, resp){
  logger.info('Log response object.', resp);
});

When execute above code, RangeError occurs. And formatter is called is not printed in log

Similar to #100

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
thinkkevincommented, May 4, 2016

The fix is add below code before https://github.com/winstonjs/winston/blob/master/lib/winston/common.js#L217

options.meta = meta;

Need to have options.meta decycled before clone.

2reactions
avindracommented, Jan 20, 2017

This has been published, issue can be closed out

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Maximum call stack size exceeded error
It means that somewhere in your code, you are calling a function which in turn calls another function and so forth, until you...
Read more >
JavaScript RangeError: Maximum Call Stack Size Exceeded
The RangeError: Maximum call stack size exceeded is thrown when a function call is made that exceeds the call stack size. This can...
Read more >
RangeError: Maximum call stack size exceeded - GitLab
Thank for you for publishing this reporter. I'm trying to use it in one of my projects, and I'm running into this issue....
Read more >
InternalError: too much recursion - JavaScript - MDN Web Docs
The JavaScript exception "too much recursion" or "Maximum call stack size exceeded" occurs when there are too many function calls, or a function...
Read more >
6.5: Confused! Keeps saying RangeError: Maximum call stack ...
Keeps saying RangeError: Maximum call stack size exceeded. ... You'll have better response, if you'll use the formatting tools to begin with.
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