versatile-dashboard-theme icon indicating copy to clipboard operation
versatile-dashboard-theme copied to clipboard

gulp build fails

Open murrekatt opened this issue 7 years ago • 5 comments

I just downloaded the theme and wanted to build it but after bower install && npm install it fails when running gulp build like so:

(node:13596) DeprecationWarning: process.EventEmitter is deprecated. Use require('events') instead.
[15:28:55] Starting 'clean'...
[15:28:56] Finished 'clean' after 20 ms
[15:28:56] Starting 'build'...
[15:28:56] Starting 'jshint'...
[15:28:56] Starting 'styles'...
[15:28:56] Starting 'images'...
[15:28:56] Starting 'fonts'...
[15:28:56] Starting 'extras'...
[15:28:56] Finished 'build' after 822 ms
[15:28:57] Finished 'jshint' after 1.15 s
[15:28:57] Finished 'images' after 407 ms
[15:28:58] Finished 'styles' after 1.82 s
[15:28:58] Starting 'html'...
[15:28:58] Finished 'extras' after 1.89 s

events.js:160
      throw er; // Unhandled 'error' event
      ^
Error: styles/main.css: error: couldn't process source due to parse error
Unexpected character '@' (1:0)

Googling for this seems like an ocean of all kinds of issues around node, bootstrap and tools. Any idea what versions or setup should work or how to start resolving this?

murrekatt avatar May 02 '17 13:05 murrekatt

Already tried various versions of node, bootstrap and angular without any success.

murrekatt avatar May 02 '17 13:05 murrekatt

I have this exactly same issue, but with the 'AniTheme':

(node:4872) DeprecationWarning: process.EventEmitter is deprecated. Use require('events') instead.
[00:56:57] Starting 'clean'...
[00:56:57] Finished 'clean' after 40 ms
[00:56:57] Starting 'build'...
[00:56:57] Starting 'jshint'...
[00:56:58] Starting 'styles'...
[00:56:58] Starting 'images'...
[00:56:58] Starting 'lang'...
[00:56:58] Starting 'fonts'...
[00:56:58] Starting 'extras'...
[00:56:58] Finished 'build' after 786 ms
[00:57:00] Finished 'extras' after 1.74 s
[00:57:01] Finished 'lang' after 2.83 s
[00:57:03] Finished 'images' after 4.52 s
[00:57:04] Finished 'styles' after 6.09 s
[00:57:04] Starting 'html'...

events.js:160
      throw er; // Unhandled 'error' event
      ^
Error: styles\main.css: error: couldn't process source due to parse error
Unexpected character '@' (1:0)

I noticed we both have the DeprecationWarning.

Node version: v6.10.3 Gulp version: 3.9.1

allanpoppe avatar May 04 '17 04:05 allanpoppe

I have same versions, but have tried with various others too with similar results.

murrekatt avatar May 04 '17 18:05 murrekatt

The issue is related to broken regex for conditional. A patch looks like this.

diff --git a/gulpfile.js b/gulpfile.js
index 3fbadef..d19cd08 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -36,12 +36,12 @@ gulp.task('html', ['styles'], function() {

   return gulp.src('app/**/*.html')
     .pipe(assets)
-    .pipe($.if('*.js', $.ngAnnotate()))
-    .pipe($.if('*.js', $.uglify()))
-    .pipe($.if('*.css', cssChannel()))
+    .pipe($.if('.*\.js', $.ngAnnotate()))
+    .pipe($.if('.*\.js', $.uglify()))
+    .pipe($.if('.*\.css', cssChannel()))
     .pipe(assets.restore())
     .pipe($.useref())
-    .pipe($.if('*.html', $.htmlmin({collapseWhitespace: true})))
+    .pipe($.if('.*\.html', $.htmlmin({collapseWhitespace: true})))
     .pipe(gulp.dest('dist'));
 });

Unfortunately this just uncovered another issue opening index.html:

Uncaught Error: [$injector:unpr] Unknown provider: $$asyncCallbackProvider <- $$asyncCallback <- $animate <- $compile
http://errors.angularjs.org/1.4.14/$injector/unpr?p0=%24%24asyncCallbackProvider%20%3C-%20%24%24asyncCallback%20%3C-%20%24animate%20%3C-%20%24compile
    at vendor.js:68
    at vendor.js:4381
    at Object.getService [as get] (vendor.js:4529)
    at vendor.js:4386
    at getService (vendor.js:4529)
    at Object.invoke (vendor.js:4561)
    at $AnimateProvider.origProvider.$get (vendor.js:4456)
    at Object.invoke (vendor.js:4570)
    at vendor.js:4387
    at getService (vendor.js:4529)

murrekatt avatar May 10 '17 13:05 murrekatt

Looking at this issue it seems Angular must be fixed to 1.3.17, so cleaning all with git clean -fxd and then modifying bower.json to only accept that version results in starting the project.

Now it would just be nice to update things to more recent Angular... ;-)

murrekatt avatar May 10 '17 13:05 murrekatt