Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Angular 10 Update Generic type 'ModuleWithProviders' requires 1 type argument(s). #456

Open

Description

@PauloPeres

WHERE:
@akveo/ng2-completer/src/modules/ng2-completer.module.d.ts:3:23 - error TS2314: Generic type 'ModuleWithProviders' requires 1 type argument(s).
3 static forRoot(): ModuleWithProviders;

According to Angular 10 it's now necessary to have a generic type
https://angular.io/guide/migration-module-with-providers

Activity

  1. changed the title [-]Angular 10 Update[/-] [+]Angular 10 Update Generic type 'ModuleWithProviders' requires 1 type argument(s).[/+] on Jul 23, 2020
  2. vamidi commented on Oct 21, 2020

    @vamidi

    Hopefully a fix for this soon!

  3. PauloPeres commented on Oct 21, 2020

    @PauloPeres
    Author

    @vamidi sent a pull request but looks like no one answered yet, not sure if this rep has people maintaining.

  4. vamidi commented on Oct 21, 2020

    @vamidi

    So unfortunate that there is no update there are a few frameworks that rely on this.

  5. aaron-harvey commented on Oct 22, 2020

    @aaron-harvey

    I used patch-package with

    diff --git a/node_modules/ng2-completer/src/modules/ng2-completer.module.d.ts b/node_modules/ng2-completer/src/modules/ng2-completer.module.d.ts
    index f1dd11a..860a84c 100644
    --- a/node_modules/ng2-completer/src/modules/ng2-completer.module.d.ts
    +++ b/node_modules/ng2-completer/src/modules/ng2-completer.module.d.ts
    @@ -1,5 +1,5 @@
     import { ModuleWithProviders } from "@angular/core";
     export declare class Ng2CompleterModule {
    -    static forRoot(): ModuleWithProviders;
    -    static forChild(): ModuleWithProviders;
    +    static forRoot(): ModuleWithProviders<Ng2CompleterModule>;
    +    static forChild(): ModuleWithProviders<Ng2CompleterModule>;
     }

    As a stop gap

    Hopefully a more permanent fix is merged soon.

  6. BruneXX commented on Mar 16, 2021

    @BruneXX

    Thanks @aaron-harvey that tool is awesome! :)

  7. dilankamr commented on Mar 25, 2021

    @dilankamr

    Hi All,

    I have forked the project and fixed the issue, If anyone wants the fix, replace your "ng2-completer": "^9.0.1" dependency line in package.json with this line: "ng2-completer": "git+https://github.com/dilankamr/ng2-completer.git"

    Or run the command: npm install git+https://github.com/dilankamr/ng2-completer.git --save

    And do an npm install.

    Then, your project will run nicely without any issue. :)

    Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions