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

src() doesn't work with wildcards (4.0.2 -> 5.0.0) #2811

Open
lik3as opened this issue Jun 24, 2024 · 8 comments
Open

src() doesn't work with wildcards (4.0.2 -> 5.0.0) #2811

lik3as opened this issue Jun 24, 2024 · 8 comments

Comments

@lik3as
Copy link

lik3as commented Jun 24, 2024

What were you expecting to happen?

all html files in src/html/**/*.html to be in the dist/ directory

What actually happened?

none of the files were in the dist/ dir

Please give us a sample of your gulpfile

gulp.task("build-html", async function () {
  return gulp
    .src("src/html/**/*.html")
    .pipe(
      fileinclude({
        context: layout,
        prefix: "@@",
        basepath: "@file",
        indent: true,
      })
    )
    .pipe(gulp.dest("dist"));
});

Terminal output / screenshots

gulpjs1

$ yarn gulp build-html
$ ls dist/

Please provide the following information:

  • OS & version: Ubuntu 22.04.4 (WSL 2)
  • node version: 22.0.0
  • npm version: 9.6.4
  • gulp version: 5.0.0

Additional information

When using 4.0.2, the program works as expected. So the current solution is downgrading the gulp version.

@emimoun2
Copy link

i have the same issue
its copy part of file

@phated
Copy link
Member

phated commented Jun 24, 2024

What happens if you remove async on your function? You can't combine promise-returning and stream-returning functions.

@lik3as
Copy link
Author

lik3as commented Jun 25, 2024

What happens if you remove async on your function? You can't combine promise-returning and stream-returning functions.

this happens:
[15:34:34] The following tasks did not complete: build-html
[15:34:34] Did you forget to signal async completion?
error Command failed with exit code 1.

(i accidentally closed the issue)

@lik3as lik3as closed this as completed Jun 25, 2024
@lik3as lik3as reopened this Jun 25, 2024
@phated
Copy link
Member

phated commented Jun 25, 2024

Sounds like your fileinclude plugin is broken, maybe it is emitting an error that's being lost.

Gulp 5 changed the underlying stream implementation and misbehaving stream implementations aren't supported anymore.

@lik3as
Copy link
Author

lik3as commented Jun 25, 2024

I tested and the error still occurs when I remove fileInclude:
image

Also, it runs normally when using the callback (but still doesn't include all glob matching files)
image

@redmnat
Copy link

redmnat commented Jul 10, 2024

I have the exact same issue coming from 4.0.2. Using a simple src to dest stream fails with "Did you forget to signal async completion?" when using a wildcard.

Works:
gulp.src('src/index.html')

Fails:
gulp.src('src/*.html')

@ealcantara22
Copy link

ealcantara22 commented Aug 29, 2024

I have the same issue, I started migrating to gulp v5 and faced this.

gulp: v5.0.0
node: v20.14.0
npm: 10.7.0
macOS: 14.6.1 Sonoma

@thomjjames
Copy link

Also getting this with Gulp 5, downgrading to version 4 and it seems to work ok:

yarn add gulp@4

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

6 participants