Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

gulp compile Error - Can only pipe to one destination


Hi,

Everything was working well until mid-March (around the 16th or 17th). I would compile using the gulp compile command on my production server before handing things over to Nginx:


...
# Load environment variables from the env file
COPY $ENV_FILE .env
RUN chmod +r .env

# Build the client code using gulp
RUN gulp compile --verbose

# Use Nginx as the base image for serving the built files
# FROM nginx:stable
FROM openresty/openresty
...


However, this error started appearing:


[08:22:49] Using gulpfile /opt/metronic_html_v8.2.3_demo39/tools/gulpfile.js
[08:22:49] Starting "compile"...
[08:22:49] Starting "cleanTask"...
[08:22:49] Finished "cleanTask" after 91 ms
[08:22:49] Starting "buildBundleTask"...
[08:22:50] Finished "buildBundleTask" after 472 ms
[08:22:50] Finished "compile" after 592 ms
/root/.nvm/versions/node/v16.20.2/lib/node_modules/gulp/node_modules/streamx/index.js:255
if (this.pipeTo !== null) throw new Error("Can only pipe to one destination")
^

Error: Can only pipe to one destination
at ReadableState.pipe (/root/.nvm/versions/node/v16.20.2/lib/node_modules/gulp/node_modules/streamx/index.js:255:37)
at Transform.pipe (/root/.nvm/versions/node/v16.20.2/lib/node_modules/gulp/node_modules/streamx/index.js:696:25)
at add (/opt/metronic_html_v8.2.3_demo39/tools/node_modules/merge-stream/index.js:29:12)
at Array.forEach (<anonymous>)
at add (/opt/metronic_html_v8.2.3_demo39/tools/node_modules/merge-stream/index.js:22:14)
at Array.forEach (<anonymous>)
at module.exports (/opt/metronic_html_v8.2.3_demo39/tools/node_modules/merge-stream/index.js:16:41)
at buildBundleTask (file:///opt/metronic_html_v8.2.3_demo39/tools/gulp/compile.js:174:12)
at bound (node:domain:433:15)
at runBound (node:domain:444:12)


Initially, I thought it was something I had changed, but it seems to be something else. As you can see in the above code, I tried the same gulp compile with the original code, and it's the same error. This only started appearing in mid-March 2024. It seems a library has changed somewhere, which has caused this issue.

I've tried different versions of node/npm: 16.20.2, 20.13.1, 21.3.0, and the same error occurs.

OS: Ubuntu 23.10

Strangely enough, "gulp compile" works on my local Windows instance.

Thank you for the help in advance.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (5)


Hi

We appreciate your feedback and will look into this bug on Metronic.

Thanks for your patience and for helping improve the product!



yes,please fix this bug



I'm glad to hear! It's possible that a recent change in one of your npm dependencies caused the problem.

If you need any further assistance, feel free to ask!



Thanks, @Faizal. The bug is still in your code, though, and it's worth looking into at some point. As mentioned above, I tested it on raw Metronic v8.2.3 and v8.2.5, and the bug is reproducible.



OK, I've switched to compiling with Yarn and it's working again:


# Remove any old instances of Yarn
RUN rm -f /usr/local/bin/yarnpkg
RUN rm -f /usr/local/bin/yarn

# Install Yarn globally
RUN npm install --global yarn

# Install Gulp CLI and Webpack CLI globally
RUN npm install -g gulp-cli

# Install project dependencies located in the tools directory
# RUN npm install

# Link global gulp to local gulp
# RUN npm link gulp

# Install project dependencies located in the tools directory
RUN yarn

# Change working directory
WORKDIR /usr/src/app

# Copy the client code
COPY ./qm-client .

# Accept an ENV_FILE build argument
ARG ENV_FILE

# Change working directory to tools to install dependencies
WORKDIR /usr/src/app/tools

# Load environment variables from the env file
COPY $ENV_FILE .env
RUN chmod +r .env

# Build the client code using gulp
RUN gulp


Don't ask me why it worked before with npm install but it did and then stopped working. Now with yarn it compiles and deploys happy .


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(