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.

[1.0.0] Unable to build typescript project with new version

See original GitHub issue

Hello.

I’m trying to upgrade to isomorphic-git 1.0.0. Congratulations on the milestone, by the way!

I’m running into an error with typescript in my node project whenever I try to build and run tsc --build :

node_modules/isomorphic-git/http/node/index.d.ts(90,27): error TS2339: Property 'onProgress' does not exist on type 'GitHttpRequest'.
node_modules/isomorphic-git/index.d.ts(931,121): error TS2339: Property 'debug' does not exist on type '{ fs: CallbackFsClient | PromiseFsClient; onProgress?: ProgressCallback; dir: string; gitdir?: string; ref?: string; filepaths?: string[]; ... 4 more ...; force?: boolean; }'.

I’m using typescript 3.8.2 and this was working perfectly with the previous isomorphic-git version.

Thanks for your help!

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
chmaccommented, Feb 27, 2020

Workaround

FYI, I’ve monkey patched this locally thanks to the awesome patch-package package, how very meta!

Here’s my patch file which allows me to build:

diff --git a/node_modules/isomorphic-git/http/node/index.d.ts b/node_modules/isomorphic-git/http/node/index.d.ts
index d1c6a00..0cc5fc7 100644
--- a/node_modules/isomorphic-git/http/node/index.d.ts
+++ b/node_modules/isomorphic-git/http/node/index.d.ts
@@ -1,3 +1,5 @@
+import { ProgressCallback } from "isomorphic-git";
+
 export default index;
 export type GitHttpRequest = {
     /**
@@ -87,4 +89,4 @@ declare namespace index {
  * @param {GitHttpRequest} request
  * @returns {Promise<GitHttpResponse>}
  */
-export function request({ onProgress, url, method, headers, body, }: GitHttpRequest): Promise<GitHttpResponse>;
+export function request({ onProgress, url, method, headers, body, }: GitHttpRequest & {onProgress: ProgressCallback}): Promise<GitHttpResponse>;
diff --git a/node_modules/isomorphic-git/index.d.ts b/node_modules/isomorphic-git/index.d.ts
index a8ff5f3..bc97352 100644
--- a/node_modules/isomorphic-git/index.d.ts
+++ b/node_modules/isomorphic-git/index.d.ts
@@ -939,6 +939,7 @@ export function checkout({ fs, onProgress, dir, gitdir, remote, ref: _ref, filep
     noCheckout?: boolean;
     noUpdateHead?: boolean;
     dryRun?: boolean;
+    debug?: boolean;
     force?: boolean;
 }): Promise<void>;
 /**

This goes into patches/isomorphic-git+1.0.0.patch.

0reactions
AxelTerizakicommented, Feb 29, 2020

I confirm it now builds, thank you 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to compile TypeScript sub-project · Issue #416 - GitHub
I am following the published guides trying to add (basic) support for the Dutch language, however I am facing an error while building...
Read more >
How to set up TypeScript
To do this, run npm install -g typescript . This will install the latest version (currently 4.9). An alternative is to use npx...
Read more >
Trouble getting simple Typescript file to run - Stack Overflow
I am using Windows 10 if that makes a difference. > part9@1.0.0 ts-node C:\Users\user\Documents\ ...
Read more >
A Complete Guide to Using TypeScript in Node.js - Better Stack
We need to set up a configuration file ( tsconfig.json ) for our project before we can start compiling our source files. If...
Read more >
Npm install command failing with message "could not find ...
I was following the project setup. When I run the npm install command, npm starts downloading the dependencies. But then, suddenly, it stops ......
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