Skip to content
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

Bundling fails due to json parse issue #102

Open
moso80 opened this issue Nov 30, 2017 · 0 comments
Open

Bundling fails due to json parse issue #102

moso80 opened this issue Nov 30, 2017 · 0 comments
Labels

Comments

@moso80
Copy link

moso80 commented Nov 30, 2017

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants