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 runSequence doesn't finish (Windows Powershell) #2013

Closed
1 of 3 tasks
stayawayknight opened this issue Dec 13, 2017 · 5 comments
Closed
1 of 3 tasks

Gulp build runSequence doesn't finish (Windows Powershell) #2013

stayawayknight opened this issue Dec 13, 2017 · 5 comments

Comments

@stayawayknight
Copy link

stayawayknight commented Dec 13, 2017

I'm submitting a ...

  • bug report
  • feature request
  • other (Please do not submit support requests here (below))

The runSequence of the task "build" in the gulpfile.babel.js does not finish properly after running "gulp build". For this reason, the task "modernizr" is not being executed (see comments here). This is caused by the task "copy:index.html", the callback function seems not to be called in time and therefore this task is never finished, preventing other tasks (like "modernizr") from being executed.

@roblarsen
Copy link
Member

I'm not seeing any issues with the build locally. Travis is cool Can you give me some more details about your setup?

@stayawayknight
Copy link
Author

stayawayknight commented Dec 14, 2017

nodejs version: 8.9.3
npm version: 5.6.0
gulp version: 3.9.1
OS: Win 10, 64 bit

I'm doing the following:

  1. Cloning the repo (release v6.0.1)
  2. Running npm install
  3. Executing gulp build

At this point I receive the following console output:
[23:01:43] Requiring external module babel-register
[23:01:44] Using gulpfile C:\xampp\htdocs\GulpTest\gulpfile.babel.js
[23:01:44] Starting 'build'...
[23:01:44] Starting 'clean'...
[23:01:44] Starting 'lint:js'...
[23:01:46] Finished 'lint:js' after 1.43 s
[23:01:46] Finished 'clean' after 1.45 s
[23:01:46] Starting 'copy:.htaccess'...
[23:01:46] Starting 'copy:index.html'...
[23:01:46] Starting 'copy:jquery'...
[23:01:46] Starting 'copy:license'...
[23:01:46] Starting 'copy:main.css'...
[23:01:46] Finished 'copy:main.css' after 335 ms
[23:01:46] Starting 'copy:misc'...
[23:01:46] Starting 'copy:normalize'...
[23:01:46] Finished 'copy:normalize' after 178 ms
[23:01:46] Finished 'copy:.htaccess' after 669 ms
[23:01:46] Finished 'copy:license' after 529 ms
[23:01:46] Finished 'copy:jquery' after 540 ms
[23:01:47] Finished 'copy:misc' after 323 ms
(nothing more)

Obviously the task "copy:index.html" did not finish. I am able to fix this by changing the task definition to:

gulp.task('copy:index.html', (done) => {
    sri.hash('node_modules/jquery/dist/jquery.min.js', (err, hash) => {
        if (err) throw err

        let version = pkg.devDependencies.jquery;
        let modernizrVersion = pkg.devDependencies.modernizr;
        gulp.src(`${dirs.src}/index.html`)
            .pipe(plugins().replace(/{{JQUERY_VERSION}}/g, version))
            .pipe(plugins().replace(/{{MODERNIZR_VERSION}}/g, modernizrVersion))
            .pipe(plugins().replace(/{{JQUERY_SRI_HASH}}/g, hash))
            .pipe(gulp.dest(dirs.dist));
    });
    done();
});

Please notice that the location of the call of the callback function has changed in this snippet. I don't know why it seems to work on Travis and not on my local machine. Please tell me if you need further information. :-)

@coliff
Copy link
Member

coliff commented Jan 22, 2018

This sounds like it may be related to: #1997 (#1997).
If you don't have git bash, which comes with git for windows then I think it will fail at that point.

@roblarsen
Copy link
Member

Ah, I continue to look at these things in Git bash and never see the failures.

@roblarsen roblarsen added this to the 6.1.0 milestone Mar 6, 2018
@coliff coliff changed the title Gulp build runSequence doesn't finish Gulp build runSequence doesn't finish (Windows Powershell) Mar 6, 2018
@roblarsen
Copy link
Member

closed via #2031

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

No branches or pull requests

3 participants