Skip to content

Extra long "Issues checking in progress..." whitch finish with "memory leak" exception #569

@mixalbl4-127

Description

@mixalbl4-127

Current behavior

It looks like this, but it was fixed: #426

Make file: Api.ts

/* eslint-disable */
/* tslint:disable */
import { HttpClient } from "./http-client";

export class Api<SecurityDataType = unknown> {
  constructor(private http: HttpClient<SecurityDataType>) {}

    abc1 = () => this.http.request();
    abc2 = () => this.http.request();
    abc3 = () => this.http.request();
}

and http-client.ts

/* eslint-disable */
/* tslint:disable */

/** Overrided Promise type. Needs for additional typings of `.catch` callback */
type TPromise<ResolveType, RejectType = any> = Omit<Promise<ResolveType>, "then" | "catch"> & {
  then<TResult1 = ResolveType, TResult2 = never>(
    onfulfilled?: ((value: ResolveType) => TResult1 | PromiseLike<TResult1>) | undefined | null,
    onrejected?: ((reason: RejectType) => TResult2 | PromiseLike<TResult2>) | undefined | null,
  ): TPromise<TResult1 | TResult2, RejectType>;
  catch<TResult = never>(
    onrejected?: ((reason: RejectType) => TResult | PromiseLike<TResult>) | undefined | null,
  ): TPromise<ResolveType | TResult, RejectType>;
};

export interface HttpResponse<D extends unknown, E extends unknown = unknown> extends Response {
  data: D;
  error: E;
}

export class HttpClient<SecurityDataType = unknown> {
  public request = <T = any, E = any>(): TPromise<HttpResponse<T, E>> => {
    return '' as any;
  };
}

try to compile, you will see that "Issues checking in progress..." process take extra long time ~15 sec.
I dont know why, but if you Copy-Paste http-client.ts to Api.ts directly this check take <1 sec.

This files make this lib https://github.com/acacode/swagger-typescript-api with ~1000 this.http.request, and each this.http.request() took ~7 sec of checking. When I do this in intel i7 CPU, after ~30 min of compiling I got error about memory leak.

Video: https://user-images.githubusercontent.com/3511307/108701953-4a842480-7511-11eb-9924-7f3c0c60acd0.mp4

Environment

  • fork-ts-checker-webpack-plugin: 6.1.0
  • typescript: 3.9.9
  • eslint: 6.8.0
  • webpack: 4.46.0
  • os: Linux mint 18.3 KDE

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions