RangeError: Maximum call stack size exceeded
See original GitHub issueWhen 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:
- Created 9 years ago
- Comments:26 (2 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
gulp-sourcemaps 1.4.0 fixes my original issue and my example test case (https://github.com/AgentME/sm-test).
Use the largeFiles option.