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.

Version 1.1.0 breaks typescript imports

See original GitHub issue

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!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lazdcommented, 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.

1reaction
schw4rzlichtcommented, Apr 27, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript imports not working · Issue #5082 · axios ... - GitHub
I am importing axios as follows into my typescript project: import axios from 'axios'; which compiles ... 1.1.0 is the last working version....
Read more >
Documentation - TypeScript 3.8
import type only imports declarations to be used for type annotations and declarations. It always gets fully erased, so there's no remnant of...
Read more >
Documentation - TypeScript 4.5
TypeScript 4.5 supports an ECMAScript proposal for import assertions. This is a syntax used by runtimes to make sure that an import has...
Read more >
Documentation - TypeScript 4.9
TypeScript 4.9 adds the other half, and now provides “Remove Unused Imports”. TypeScript will now remove unused import names and statements, but will...
Read more >
Documentation - TypeScript 4.7
Node.js allows ES modules to import CommonJS modules as if they were ES modules with a default export. ts. // ./ ...
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