Skip to content

Bundling fails due to json parse issue #102

@moso80

Description

@moso80

Hi,

I sometimes get this error when i save a script- or sass-file:
Unhandled rejection SyntaxError: Unexpected end of JSON input
at JSON.parse (:null:null)
at D:\develop\client\src\Web\node_modules\gulp-bundle-assets\lib\results\index.js:110:49
at tryCatcher (D:\develop\client\src\Web\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (D:\develop\client\src\Web\node_modules\bluebird\js\release\promise.js:502:31)
at Promise._settlePromise (D:\develop\client\src\Web\node_modules\bluebird\js\release\promise.js:559:18)
at Promise._settlePromise0 (D:\develop\client\src\Web\node_modules\bluebird\js\release\promise.js:604:10)
at Promise._settlePromises (D:\developclient\src\Web\node_modules\bluebird\js\release\promise.js:683:18)
at Promise._fulfill (D:\develop\client\src\Web\node_modules\bluebird\js\release\promise.js:628:18)
at D:\develop\client\src\Web\node_modules\bluebird\js\release\nodeback.js:42:21
at D:\develop\client\src\Web\node_modules\gulp-bundle-assets\node_modules\graceful-fs\graceful-fs.js:78:16
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:528:3)

I can't find any pattern of when this error accours.

gulp-task:
gulp.task('watch',
function () {
gbundle.watch({
configPath: path.join(__dirname, '/bundle.config.js'),
results: {
dest: path.join(__dirname, '/bundles/'),
pathPrefix: '/bundles/',
fileName: 'bundle.result',
unprocessedOutputPathPrefix: "/",
sortUnprocessedOutput: false
},
dest: path.join(__dirname, '/bundles/')
});
});

Example of bundle:
main: {
scripts: [
config.paths.globalScripts
],
styles: [
config.paths.baseLessFile,
config.paths.baseSassFile,
config.paths.cssFiles,
"!Styles/admin/*.css"
],
options: {
uglify: prodLikeEnvs,
minCSS: prodLikeEnvs,
watch: {
styles: config.paths.globalStyles,
scripts: config.paths.globalScripts
},
maps: false,
result: {
type: {
scripts: scriptResult
}
},
transforms: {
styles: styleTransforms
},
rev: prodLikeEnvs
}
}

Any idea whats causing this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions