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

See original GitHub issue

When trying to run browserify+uglify using gulp-sourcemaps, I get the following error:

node_modules/gulp-sourcemaps/node_modules/convert-source-map/index.js:109
  var m = content.match(commentRx);
                  ^
RangeError: Maximum call stack size exceeded

The gulp task looks a bit like this:

var browserify = require('browserify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');

gulp.task('bundle', function () {
    var bundle = browserify({
        debug: true,
    });
    bundle.bundle()
    .on('error', gutil.log.bind(gutil, 'Browserify Error'))
    .pipe(source(getBundleName('client')))
    .pipe(buffer())
    .pipe(sourcemaps.init({loadMaps: true}))
    .pipe(uglify())
    .pipe(sourcemaps.write('./'))
    .pipe(gulp.dest('./build'));
});

This happens with gulp-sourcemaps 1.2.8. Downgrading to 1.1.0 fixes it. With 1.2.8, this issue occurs even if the uglify line is commented out.

The same issue also occurs unless I specifically use gulp-uglify 0.3.1. Any later version also breaks it.

Possibly this is something to do with very large sourcemaps.

Any help would be much appreciated.

Thanks.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:26 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Macilcommented, Feb 25, 2015

gulp-sourcemaps 1.4.0 fixes my original issue and my example test case (https://github.com/AgentME/sm-test).

0reactions
nmccreadycommented, Dec 4, 2016

Use the largeFiles option.

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 Error: Maximum Call Stack Size Exceeded
If you see the “Maximum Call Stack Size Exceeded” error, there's likely a problem with a recursive function within your JavaScript code.
Read more >
Uncaught RangeError: Maximum call ... - Net-Informations.Com
This error is almost always means you have a problem with recursion in JavaScript code, as there isn't any other way in JavaScript...
Read more >
RangeError: Maximum call stack size exceeded - Educative.io
The most common source for this error is infinite recursion. You must have a recursive function in your code whose base case is...
Read more >
RangeError: Maximum call stack size exceeded in JavaScript
The "RangeError: Maximum call stack size exceeded" error occurs when a function is called so many times that the invocations exceed the call...
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