-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Out of memory error on jsx processing #558
Comments
Node version? Can you put up a reproducible example? BTW I find it faster to skip |
I put logging to 6to5ify. Generated source code and source maps are duplicated and grow on each transform call even if I reset the // ...
return function (filename) {
// ...
var data = "";
var write = function (buf) {
data += buf;
console.log('data', data);
};
var end = function () {
var opts2 = _.clone(opts);
opts2.filename = filename;
try {
var out = to5.transform(data, opts2).code;
} catch(err) {
stream.emit("error", err);
stream.queue(null);
return;
}
stream.queue(out);
stream.queue(null);
data = '';
};
var stream = through(write, end);
return stream;
}; |
Disabling source maps and ignoring node_modules gives the same result. |
I suppose this is 6to5ify issue then? |
I don't think so. Other transformation libs use the same approach with |
Where does duplication occur? I don't quite understand yet. |
@gaearon, you're absolutely right, my browserify task was wrongly configured. I put transform outside the var bundler = browserify({...});
bundler.transform(_6to5.configure({
ignore: 'node_modules',
sourceMap: false
}));
var bundle = function() {
return bundler
.external(externalLibs)
// previously it was here
//.transform(_6to5)
.bundle()
.on('error', handleErrors)
.pipe(source('app.js'))
.pipe(gulp.dest('./build/'))
.on('end', bundleLogger.end);
}; This link helped me to catch the problem: https://github.com/gulpjs/gulp/blob/master/docs/recipes/fast-browserify-builds-with-watchify.md |
Thank you for sharing the solution! |
This was giving me a headache too, thanks for this! |
… called (fixes #558)(#559) * Prevent parseForESLint() behavior from changing after parse() is called (fixes babel/babel-eslint#558, fixes eslint/eslint#9767) * Avoid using the enhanced referencer after monkeypatching * Chore: add test for #558 * Pass correct scope analyzer options * fix escope patch and improve tests * remove process.exit(1)
I am using 6to5 with jsx, gulp and browserify. After several file changes 6to5 crashes with error:
FATAL ERROR: JS Allocation failed - process out of memory
. I've found out that the problem is with my jsx source by simply switching entry point to js file instead jsx. See the console trace and my configuration below. Pay attention on increasing build time after each bundle change.Tested with the latest 6to5-core
Browserify Gulp task:
test_app.jsx:
The text was updated successfully, but these errors were encountered: