I am using jquery and express (maybe) project.
This project node version is 12
If I run
gulp watch
Then It work.
But after I change my script file because of editing code,
[10:47:42] Finished 'js' after 984 ms
[10:47:42] Starting 'js'...
[Browsersync] 21 files changed (artist-calendar.min.js, artist-register.min.js, client-list.min.js, contact-register-confirm.min.js, contact-register.min.js, editable.min.js, globals.min.js, invoice.min.js, login.min.js, popup-artist-confirm.min.js, popup-artist-modify.min.js, profile.min.js, staff-calendar.min.js, staff-schedule-register.min.js, studio-calendar.min.js, studio-register-confirm.min.js, studio-schedule-register.min.js, user-list-table.min.js, user-modify.min.js, user-register.min.js, utils.min.js)
Above message keep showing.
After about 2 hours, frontend is shutdown and show below error
<--- Last few GCs --->
5)[15816:000001E38D34A920] 2103240 ms: Mark-sweep 2041.6 (2059.4) -> 2038.3 (2060.9) MB, 295.0 / 1.7 ms (+ 493.2 ms in 104 steps since start of marking, biggest step 15.6 ms, walltime since start of marking 81 1: 00007FF670833B5F napi_wrap+119263
2: 00007FF6707DA4A6 v8::internal::OrderedHashTable<v8::internal::OrderedHashSet,1>::NextTableOffset+38102
3: 00007FF6707DB2A6 node::OnFatalError+438
4: 00007FF671019C1E v8::Isolate::ReportExternalAllocationLimitReached+94
5: 00007FF671001DD1 v8::SharedArrayBuffer::Externalize+833
6: 00007FF670EB358C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1436
7: 00007FF670EBE7D0 v8::internal::Heap::ProtectUnprotectedMemoryChunks+1312
8: 00007FF670EBB2E4 v8::internal::Heap::PageFlagsAreConsistent+3204
9: 00007FF670EB0AE3 v8::internal::Heap::CollectGarbage+1283
10: 00007FF670EAF154 v8::internal::Heap::AddRetainedMap+2500
11: 00007FF670ED049D v8::internal::Factory::NewFillerObject+61
12: 00007FF670C33A91 v8::internal::interpreter::JumpTableTargetOffsets::iterator::operator=+1665
13: 00007FF67146F4BD v8::internal::SetupIsolateDelegate::SetupHeap+546925
14: 00007FF6714703ED v8::internal::SetupIsolateDelegate::SetupHeap+550813
15: 000000DDDA80A38E
Why it is happen and I can I solve?
My gulp file is below
"use strict";
// Load plugins
const autoprefixer = require("gulp-autoprefixer");
const browsersync = require("browser-sync").create();
const cleanCSS = require("gulp-clean-css");
const del = require("del");
const gulp = require("gulp");
const header = require("gulp-header");
const merge = require("merge-stream");
const plumber = require("gulp-plumber");
const rename = require("gulp-rename");
const sass = require("gulp-sass");
const uglify = require("gulp-uglify");
const http = require("http");
// Load package.json for banner
const pkg = require('./package.json');
// Set the banner content
const banner = ['/*!n',
' * Start - <%= pkg.title %> v<%= pkg.version %> (<%= pkg.homepage %>)n',
' * Copyright -' + (new Date()).getFullYear(), ' <%= pkg.author %>n',
' * Licensed under <%= pkg.license %> (<%= pkg.name %>)n',
' */n',
'n'
].join('');
// BrowserSync
function browserSync(done) {
browsersync.init({
ghostMode: false,
notify: false,
open: false,
server: {
baseDir: "./",
index: "login.html"
},
port: 8080
});
done();
}
// BrowserSync reload
function browserSyncReload(done) {
browsersync.reload();
done();
}
// Clean vendor
function clean() {
return del(["./vendor/"]);
}
// Bring third party dependencies from node_modules into vendor directory
function modules() {
// Bootstrap JS
var bootstrapJS = gulp.src('./node_modules/bootstrap/dist/js/*')
.pipe(gulp.dest('./vendor/bootstrap/js'));
// Bootstrap SCSS
var bootstrapSCSS = gulp.src('./node_modules/bootstrap/scss/**/*')
.pipe(gulp.dest('./vendor/bootstrap/scss'));
// ChartJS
var chartJS = gulp.src('./node_modules/chart.js/dist/*.js')
.pipe(gulp.dest('./vendor/chart.js'));
// dataTables
var dataTables = gulp.src([
'./node_modules/datatables.net/js/*.js',
'./node_modules/datatables.net-bs4/js/*.js',
'./node_modules/datatables.net-bs4/css/*.css'
])
.pipe(gulp.dest('./vendor/datatables'));
// Font Awesome
var fontAwesome = gulp.src('./node_modules/@fortawesome/**/*')
.pipe(gulp.dest('./vendor'));
// jQuery Easing
var jqueryEasing = gulp.src('./node_modules/jquery.easing/*.js')
.pipe(gulp.dest('./vendor/jquery-easing'));
// jQuery
var jquery = gulp.src([
'./node_modules/jquery/dist/*',
'!./node_modules/jquery/dist/core.js'
])
.pipe(gulp.dest('./vendor/jquery'));
return merge(bootstrapJS, bootstrapSCSS, chartJS, dataTables, fontAwesome, jquery, jqueryEasing);
}
// CSS task
function css() {
return gulp
.src("./scss/**/*.scss")
.pipe(plumber())
.pipe(sass({
outputStyle: "expanded",
includePaths: "./node_modules",
}))
.on("error", sass.logError)
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(header(banner, {
pkg: pkg
}))
.pipe(gulp.dest("./css"))
.pipe(rename({
suffix: ".min"
}))
.pipe(cleanCSS())
.pipe(gulp.dest("./css"))
.pipe(browsersync.stream());
}
// JS task
function js() {
return gulp
.src([
'./js/*.js',
'!./js/*.min.js',
])
.pipe(uglify())
.pipe(header(banner, {
pkg: pkg
}))
.pipe(rename({
suffix: '.min'
}))
.pipe(gulp.dest('./js'))
.pipe(browsersync.stream());
}
// Watch files
function watchFiles() {
gulp.watch("./scss/**/*", css);
gulp.watch("./js/**/*", js);
gulp.watch("./**/*.html", browserSyncReload);
}
// Define complex tasks
const vendor = gulp.series(clean, modules);
const build = gulp.series(vendor, gulp.parallel(css, js));
const watch = gulp.series(build, gulp.parallel(watchFiles, browserSync));
// Export tasks
exports.css = css;
exports.js = js;
exports.clean = clean;
exports.vendor = vendor;
exports.build = build;
exports.watch = watch;
exports.default = build;
0