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

Version 1.1.0 breaks typescript imports #117

Closed
schw4rzlicht opened this issue Apr 27, 2021 · 6 comments · Fixed by #114
Closed

Version 1.1.0 breaks typescript imports #117

schw4rzlicht opened this issue Apr 27, 2021 · 6 comments · Fixed by #114

Comments

@schw4rzlicht
Copy link

Hey there,

my gulpfile is written in Typescript and gulp-replace is used like this:

import replace from "gulp-replace";

function doSomething() {
  return gulp.src("directory/*.html")
    .pipe(replace("string", "anotherString"))
    .pipe(gulp.dest("anotherDirectory"));
}

exports.build = gulp.series(doSomething);

After upgrading to ~1.1.0, this breaks with

gulpfile.ts:46:35 - error TS2349: This expression is not callable.
  Type 'typeof import("<somePath>/node_modules/gulp-replace/index")' has no call signatures.

I also tried

import { replace } from "gulp-replace";
import * as replace from "gulp-replace";

but without success 😕

Any help appreciated!

@lazd
Copy link
Owner

lazd commented Apr 27, 2021

Does #114 fix it?

@schw4rzlicht
Copy link
Author

Does #114 fix it?

Oh, I only searched for issues related to my problem. The PR you mentioned deals with exactly the problem I am facing.

@lazd
Copy link
Owner

lazd commented Apr 27, 2021

@schw4rzlicht no problem, can you review/test that PR and see if it fixes the issue? Clone the repository locally, check out that branch, run npm link inside of it, then in your project npm link gulp-replace. When done testing, run npm unlink gulp-replace in your project.

@lazd
Copy link
Owner

lazd commented Apr 28, 2021

@schw4rzlicht fixed in 1.1.2, give it a spin

@schw4rzlicht
Copy link
Author

Works now. I have to import it like this now

import replace = require("gulp-replace");

which looks a bit unfamiliar but is no problem at all. Thank you very much!

@lazd
Copy link
Owner

lazd commented Apr 29, 2021

@schw4rzlicht thanks for reporting back! Yeah, it's a default export, so that makes sense

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

Successfully merging a pull request may close this issue.

2 participants