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 throws error Can only pipe to one destination #2820

Open
rvab opened this issue Sep 9, 2024 · 0 comments
Open

Gulp throws error Can only pipe to one destination #2820

rvab opened this issue Sep 9, 2024 · 0 comments

Comments

@rvab
Copy link

rvab commented Sep 9, 2024

What were you expecting to happen?

The gulp task should be executed successfully.

What actually happened?

Gulp is throwing the below error

Can only pipe to one destination 

Sample code

function generateHTML(path, withStyles) {
  let stream = src(path.html.src, {
    base: '.',
  });

  if (argv.production) {
    stream = minifyHTMLReferences(stream, withStyles);
  }

  stream.pipe(dest(path.html.dest));
  return stream;
}
const gulpWatch = series(
 generateHTML
 ...othertask
)
export { gulpWatch as watch }

Terminal output / screenshots

$ gulp watch

output

Error: Can only pipe to one destination
    at ReadableState.pipe (path-to-node_modules/node_modules/streamx/index.js:260:13)
    at Transform.pipe (path-to-node_modules/node_modules/streamx/index.js:722:25)
    at resumer (path-to-node_modules/node_modules/stream-exhaust/index.js:12:12)
    at asyncRunner (path-to-node_modules/node_modules/async-done/index.js:65:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

Please provide the following information:

  • OS & version: MacOS Sonoma 14.3.1
  • node version: v20.17.0
  • npm version: 10.8.2
  • gulp version: 5.0.0

Additional information

The below code works but when dest is set after creating stream, the task fails

function generateHTML(path, withListViewStyles) {
  return src(path.html.src, {
    base: '.',
  }).pipe(dest(path.html.dest));

}
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

1 participant