vigetlabs / blendid

A delicious blend of gulp tasks combined into a configurable asset pipeline and static site builder
MIT License
4.97k stars 680 forks source link

Browsersync keeps throwing errors on run #457

Closed artemartemov closed 6 years ago

artemartemov commented 7 years ago

Hey there

I am currently trying to integrate blendit with a rails app that I am helping out with all of the styling and sass architecture. The rails asset compiler seemed a bit rough to work with, so this seems like the perfect solution!

I seem to keep on getting errors however and not sure why:

 yarn run blendid
yarn run v0.24.5
$ "/Users/user/Projects/app/node_modules/.bin/blendid"
[11:51:32] Working directory changed to ~/Projects/app/node_modules/blendid
[11:51:33] Using gulpfile ~/Projects/app/node_modules/blendid/gulpfile.js
[11:51:33] Starting 'default'...
[11:51:33] Starting 'clean'...
[11:51:33] Finished 'clean' after 5.24 ms
[11:51:33] Starting 'stylesheets'...
[11:51:33] Finished 'stylesheets' after 22 ms
[11:51:33] Starting 'browserSync'...
[11:51:34] 'browserSync' errored after 56 ms
[11:51:34] WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration misses the property 'entry'.
   object { <key>: non-empty string | [non-empty string] } | non-empty string | [non-empty string] | function
   The entry point(s) of the compilation.
    at webpack (/Users/user/Projects/app/node_modules/webpack/lib/webpack.js:19:9)
    at Gulp.browserSyncTask (/Users/user/Projects/app/node_modules/blendid/gulpfile.js/tasks/browserSync.js:13:18)
    at module.exports (/Users/user/Projects/app/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/Users/user/Projects/app/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/Users/user/Projects/app/node_modules/orchestrator/index.js:214:10)
    at Gulp.Orchestrator.start (/Users/user/Projects/app/node_modules/orchestrator/index.js:134:8)
    at /Users/user/Projects/app/node_modules/gulp-sequence/index.js:68:12
    at apply (/Users/user/Projects/app/node_modules/thunks/thunks.js:354:38)
    at tryRun (/Users/user/Projects/app/node_modules/thunks/thunks.js:224:19)
    at runThunk (/Users/user/Projects/app/node_modules/thunks/thunks.js:217:15)
✨  Done in 1.99s.
Ballpin commented 7 years ago

@artemartemov I found a solution around that problem. Remove postbuild from development in order to avoid overwriting the default postbuild. Unless you really want to create your own postbuild. Use only prebuild, worked perfectly for me.

Leave it like this..

  additionalTasks: {
    initialize(gulp, PATH_CONFIG, TASK_CONFIG) {
      gulp.task('copyLayouts', function() {
        // the stuff task is suppose to do
      });
    },
    development: {
      prebuild: ['copyLayouts']
    },
    production: {
      prebuild: ['copyLayouts']
    }
  }