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

gulp build fails #9

Open
murrekatt opened this issue May 2, 2017 · 5 comments
Open

gulp build fails #9

murrekatt opened this issue May 2, 2017 · 5 comments

Comments

@murrekatt
Copy link

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
Copy link
Author

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

@allanpoppe
Copy link

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

@murrekatt
Copy link
Author

murrekatt commented May 4, 2017

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

@murrekatt
Copy link
Author

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
Copy link
Author

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... ;-)

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

No branches or pull requests

2 participants