gulp-sourcemaps: RangeError: Maximum call stack size exceeded
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.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 26 (2 by maintainers)
Commits related to this issue
- [gulp,package] re-enable source maps with browserify Works like a charm now that https://github.com/floridoo/gulp-sourcemaps/issues/73 is closed. — committed to paperhive/frontend by andrenarchy 9 years ago
- [gulp] disable gulp-sourcemaps temporarily disable gulp-sourcemaps until floridoo/gulp-sourcemaps/issues/73 is resolved. — committed to paperhive/frontend by andrenarchy 9 years ago
- use and expose largeSource flag in convert-source-map it is necessary for huge files. Related issues v8 https://bugs.chromium.org/p/v8/issues/detail?id=3878 nodejs https://github.com/nodejs/node/issu... — committed to bbbush/gulp-sourcemaps by bbbush 9 years ago
- use and expose largeSource flag in convert-source-map it is necessary for huge files. Related issues v8 https://bugs.chromium.org/p/v8/issues/detail?id=3878 nodejs https://github.com/nodejs/node/issu... — committed to bbbush/gulp-sourcemaps by bbbush 9 years ago
gulp-sourcemaps 1.4.0 fixes my original issue and my example test case (https://github.com/AgentME/sm-test).