question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug?] Piping not working when watch is true

See original GitHub issue

Type: bug (maybe)

What happens: Piping from webpack-stream to, say, gulp-concat isn’t working when watch is set to true.

Steps to reproduce

  1. Set up webpack-stream to accept n entries using either method in this project’s README
  2. Ensure that watch isn’t on, and pipe the output to gulp-concat.
  3. Observe that it works
  4. Turn on watch
  5. Observe that it doesn’t work

Possible cause: This might have to do with the internals of webpack’s watch changing what is sent out from the pipe? I’m not sure – gotta investigate that.

Why am I doing this?

This is likely me being a goof somewhere. My set up is that I’ve got n independent test files for a library. I want to build them with webpack into a single file that can be loaded into the browser.

Afaik webpack doesn’t support n entry points into 1 file; each independent entry point is converted into its own “chunk.” For this reason, I’m piping webpack into gulp-concat to produce a single file to load up in the browser.

I don’t want to manually maintain a list of test files, so somewhere along the line I’ve got to glob. I guess the two options are:

  1. somehow set up a require(); in my code that allows for globbing
  2. set up globbing when specifying my target files, then concatenating them

Option 1 seemed like more work (the glob-loader plugin isn’t very feature-ful…no source maps, for instance), so I was trying to do option 2.

Is this silly? : P

I’ll do my best to investigate this, but I figured I’d raise the issue in case anyone happens to know what the issue is.

p.s. super awesome library here, @shama!

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:2
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
minwecommented, Mar 21, 2016

@jmeas I’m using run-sequence, but if the webpack task set watch to true, the task after webpack will never be executed.

For example:

gulp.task('webpack', function() {
  return gulp.src('...')
    .pipe(webpack({watch: true}))
    .pipe(gulp.dest('...'));
});

gulp.task('otherTask', function() {
  return gulp.src('...');
  // ...
});

gulp.task('build', function(cb) {
  runSequence('webpack', 'otherTask', cb);
});

Then run gulp build, the wepback task will be executed, but otherTask will not.

1reaction
jamespleasecommented, Mar 21, 2016

@minwe, correct. From my description above:

Just be sure to run that (webpack-stream) task in the last “grouping” within runSequence.

The current behavior produces a never-ending and blocking stream. With hope, @minwe’s solution, #109, will be a proper solution rather than the “clever finagling” that I went with. I’ve been meaning to pull down the branch to try it out for myself, but I haven’t had the free time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Errors in `webpack` break the pipe / task · Issue #34 - GitHub
Hello,. I am using webpack and gulp to build a coffee-script app using webpack watch option. Any coffee-loader error, such as a syntax...
Read more >
Angular default pipes in library not working - Stack Overflow
It shows the message on the screen. The problem comes when I try to add a pipe of any kind, even default pipes...
Read more >
Why YOUR PIPES Don't Flow - Complete Fluids Guide ...
Checkout: Atlas VPN 3-year offer with a 82% discount;https://get.atlasvpn.com/TotalXclipseWhy YOUR PIPES Don't Flow - Complete Fluids Guide ...
Read more >
[Debugging] The pipe {name} could not be found - YouTube
In this video, you'll learn what the error "The pipe {name} could not be found" means, how to debug it, and prevent it...
Read more >
10 MISTAKES When Working With Plastic Pipes (PVC, CPVC ...
Watch this BEFORE plumbing PVC, CPVC or ABS, you won't regret it!!Stuff from Amazon I used in this video:CPVC cement and primer kit: ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found